[FFmpeg-devel] [PATCH] lavu/opt: add support for reading pixel and sample format through av_get_int()

Stefano Sabatini stefasab at gmail.com
Sun Nov 25 20:40:56 CET 2012


On date Sunday 2012-11-25 18:56:06 +0100, Michael Niedermayer encoded:
> On Sun, Nov 25, 2012 at 06:01:47PM +0100, Stefano Sabatini wrote:
> > Simplify backward compatibility, when switching from AV_OPT_TYPE_INT to
> > AV_OPT_TYPE_SAMPLE/PIXEL_FMT.
> > ---
> >  libavutil/opt.c |    2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavutil/opt.c b/libavutil/opt.c
> > index c546f8e..aa35408 100644
> > --- a/libavutil/opt.c
> > +++ b/libavutil/opt.c
> > @@ -71,6 +71,8 @@ static int read_number(const AVOption *o, void *dst, double *num, int *den, int6
> >  {
> >      switch (o->type) {
> >      case AV_OPT_TYPE_FLAGS:     *intnum = *(unsigned int*)dst;return 0;
> 
> > +    case AV_OPT_TYPE_PIXEL_FMT:
> > +    case AV_OPT_TYPE_SAMPLE_FMT:
> >      case AV_OPT_TYPE_INT:       *intnum = *(int         *)dst;return 0;
> 
> i suspect these should cast to the enum and dereference that

>From what I know the enum should be perfectly equivalent to an int,
I'll fix it if we notice some failure.

> otherwise LGTM

Thanks, applied.
-- 
FFmpeg = Fundamental and Fancy Murdering Pure Extensive Gem


More information about the ffmpeg-devel mailing list