Thank you James and Moritz.

For many of these parameters, the default value within the codec is '1'. So
we want to add the option for disabling it also.

I would like to follow the method used for "frame-parallel",  after
changing the default value to -1.

{ "frame-parallel",   "Enable frame parallel decodability features",
OFFSET(frame_parallel),  AV_OPT_TYPE_BOOL,{.i64 = -1}, -1, 1, VE},

if (frame_parallel >= 0) {
......
}

I will send the updated patch soon.




On Tue, Mar 12, 2019 at 9:14 AM Moritz Barsnick <barsn...@gmx.net> wrote:

> On Tue, Mar 12, 2019 at 11:45:06 -0300, James Almer wrote:
> > > +    { "frame-parallel",   "Enable frame parallel decodability
> features", OFFSET(frame_parallel),  AV_OPT_TYPE_BOOL,{.i64 = -1}, -1, 1,
> VE},
> >
> > A bool with three values is weird. If this is meant to be disabled by
> > default, then just make it 0 and remove the >= 0 condition above.
>
> It's actually quite common with ffmpeg options. Such an option can only
> be assigned true or false, but if it isn't assigned, it will be e.g. -1
> and can be used to trigger a default mode, as is apparently done here
> (by not setting this option through the API, probably letting the
> library do whatever it considers default).
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to