[FFmpeg-devel] [PATCH] lavu, lavfi, lavd: do not hardcode AV_PIX_FMT_NB value when setting pixel format max value

Stefano Sabatini stefasab at gmail.com
Mon Dec 16 17:59:01 CET 2013


On date Monday 2013-12-16 16:35:52 +0100, Michael Niedermayer encoded:
> On Mon, Dec 16, 2013 at 04:23:51PM +0100, Stefano Sabatini wrote:
> > The constant may change in libavutil but the library may be compiled
> > against an older version, thus rejecting a value which is otherwise
> > supported by the new libavutil.
> > 
> > INT_MAX is used here to denote the max allowed value for a pixel format.
> > 
> > The opt-test code is changed to provide a valid reference example.
> > ---
> >  libavdevice/dshow.c          | 2 +-
> >  libavfilter/vf_mergeplanes.c | 2 +-
> >  libavutil/opt.c              | 2 +-
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> > index 37efabe..2ef004e 100644
> > --- a/libavdevice/dshow.c
> > +++ b/libavdevice/dshow.c
> > @@ -1059,7 +1059,7 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
> >  #define DEC AV_OPT_FLAG_DECODING_PARAM
> >  static const AVOption options[] = {
> >      { "video_size", "set video size given a string such as 640x480 or hd720.", OFFSET(requested_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
> > -    { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, AV_PIX_FMT_NB-1, DEC },
> > +    { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, MAX_INT, DEC },
> 
> MAX_INT or INT_MAX ?

Locally fixed, thanks.
-- 
FFmpeg = Foolish and Fiendish Moronic Political Elastic Gospel


More information about the ffmpeg-devel mailing list