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

Michael Niedermayer michaelni at gmx.at
Sun Nov 25 18:56:06 CET 2012


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

otherwise LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- 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/20121125/011abc3a/attachment.asc>


More information about the ffmpeg-devel mailing list