[FFmpeg-devel] [PATCH] Fix opt_default()

Stefano Sabatini stefano.sabatini-lala
Mon Dec 15 00:08:49 CET 2008


On date Sunday 2008-12-07 18:49:21 +0100, Michael Niedermayer encoded:
> On Sun, Dec 07, 2008 at 05:10:11PM +0100, Stefano Sabatini wrote:
> > On date Sunday 2008-12-07 14:35:58 +0100, Michael Niedermayer encoded:
> > > On Sun, Dec 07, 2008 at 02:45:16AM +0100, Stefano Sabatini wrote:
[...]
> > > > As for the index in the options array, I found its use quite awkward,
> > > > but anyway if you like it I can implement this:
> > > > 
> > > > int av_set_string3(void *obj, const char *name, const char *val);
> > > 
> > > iam not insisting on this, what i insist on is that we will not have
> > > 20 return -1 and parse an error message (or check if its NULL)  to find
> > > out which kind of error it was.
> > 
> > I continue to prefer:
> > 
> > 1) int av_set_string3(void *obj, const char *name, const char *val, const AVOption **o_out);
> > (return an error code or 0 if the option has been set, put in o_out
> > the option eventually found)
> > 
> > over:
> > 
> > 2) int av_set_string3(void *obj, const char *name, const char *val);
> > (return an error code or the index in the obj->options array if the
> > option is found and the value is valid)
> > 
> > but I won't insist if you prefer the other one, please just say which
> > you prefer.
> > 
> > Advantage of 1) over 2) is that you know the option which has been
> > found even in case of error, so no need to iterate through options to
> > find it again, if you don't care about the option found you can simply
> > set o_out to NULL.
> 
> i dont mind 1.

Patchset attached.

Regards.
-- 
FFmpeg = Fiendish and Fantastic Magic Power Energized Glue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-unconsistent-ending-period.patch
Type: text/x-diff
Size: 558 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081215/d14d7cd0/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: implement-set-number2.patch
Type: text/x-diff
Size: 1517 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081215/d14d7cd0/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: implement-av-set-string3.patch
Type: text/x-diff
Size: 4616 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081215/d14d7cd0/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-opt-default.patch
Type: text/x-diff
Size: 1881 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081215/d14d7cd0/attachment-0003.patch>



More information about the ffmpeg-devel mailing list