Re: to be effcient or not to be efficient
"Toby Hudon" <[email protected]>
| Newsgroups | gmane.comp.multimedia.media-api |
|---|---|
| Message-ID | <[email protected]> |
----- Original Message ----- From: Tuukka Toivonen <[email protected]> Date: Thu, 8 Jan 2004 11:36:25 +0200 (EET) To: "The attempt to create a new, open standard codec API" <[email protected]> Subject: Re: [Media-api] to be effcient or not to be efficient > On Thu, 8 Jan 2004, Artem Baguinski wrote: > > >static vtable_t my_vtable { > > .get_next_frame = get_next_frame; /* implemented call */ > > .seek_ms = seek_ms; /* another one */ > > .seek_frame = NULL; /* not implemented call */ > > ... > >} > > If the vtable is set up by the API library (as opposed to a specific > codec/filter) it might be nicer to set unimplemented functions to > some dummy functions which just return an error instead of NULL; otherwise > the caller has to always check whether a pointer is NULL before calling the > function. > Umm... but if you have a function that just returns "not supported", won't you have to check for that every time after you call to see if what you just did produced the right result or find some way to store a state so you know not to call it? Checking for NULL first just saves the function call. -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm