[FFmpeg-devel] [PATCH 1/2] avfilter/buffersrc: specify pixel format min/max

Michael Niedermayer michaelni at gmx.at
Mon Dec 16 16:46:55 CET 2013


On Mon, Dec 16, 2013 at 11:43:05AM +0100, Nicolas George wrote:
> Le septidi 17 frimaire, an CCXXII, Michael Niedermayer a écrit :
> > i was unsure about it as well
> > but for example the min value that is allowed could be -1 or 0
> > depending on if a "not specified" format is allowed
> > though " min = FFMIN(o->min, -1);" in opt.c looks like it would
> > prevent that usecase
> > 
> > about the max the current
> > " max = FFMAX(o->max, nb_fmts-1);" in opt.c would avoid the problem
> > 
> > also iam not sure if the FFMIN/MAX where intended to be what they
> > are or if they where intended to be the other way around
> 
> This part of the code seems indeed rather strange. It looks like defensive
> programming against internal inconsistencies. I believe asserts would be
> more suited for that use: running FATE will detect the inconsistencies and
> allow to fix them.
> 

> For the min case, I suggest simply:
> 
>     av_assert0(o->min == -1 || o->min == 0);

agree

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131216/02ed2cb0/attachment.asc>


More information about the ffmpeg-devel mailing list