[Ffmpeg-devel] [PATCH] ffmpeg.c duplicate *_opts for every codec types

Michael Niedermayer michaelni
Thu Feb 22 13:58:12 CET 2007


Hi

On Thu, Feb 22, 2007 at 11:15:42AM +0100, Benoit Fouet wrote:
> Hi,
> 
> as a first step to have the "ab" and "b" options work in the same
> manner, please find attach a patch that duplicates *_opts in ffmpeg.c
> this patch needs the CODEC_TYPE_NB one.
> please review :)
> 
> Ben
> 

> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 8066)
> +++ ffmpeg.c	(working copy)
> @@ -206,8 +206,8 @@
>  
>  const char **opt_names=NULL;
>  int opt_name_count=0;
> -AVCodecContext *avctx_opts;
> -AVFormatContext *avformat_opts;
> +AVCodecContext *avctx_opts[CODEC_TYPE_NB];
> +AVFormatContext *avformat_opts[CODEC_TYPE_NB];
[...]
> @@ -2552,12 +2552,15 @@
>      if(pgmyuv_compatibility_hack)
>          ap->video_codec_id= CODEC_ID_PGMYUV;
>  
> +    for(type=0; type<CODEC_TYPE_NB; type++)
> +    {
>      for(i=0; i<opt_name_count; i++){
>          const AVOption *opt;
> -        double d= av_get_double(avformat_opts, opt_names[i], &opt);
> +        double d= av_get_double(avformat_opts[type], opt_names[i], &opt);
>          if(d==d && (opt->flags&AV_OPT_FLAG_DECODING_PARAM))
>              av_set_double(ic, opt_names[i], d);
>      }
> +    }

hmm did i suggest to split avformat_opts too? hmm maybe i did, but thats
silly of course, only avctx_opts should be split, the container is never
video/audio/subtitle specific but rather contains all, sorry

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070222/4516cbcc/attachment.pgp>



More information about the ffmpeg-devel mailing list