[Ffmpeg-devel] [PATCH] fix -ab default

Benoit Fouet benoit.fouet
Tue Mar 6 22:45:57 CET 2007


Hi,

Michael Niedermayer wrote:
> Hi
>
> On Tue, Mar 06, 2007 at 09:07:44PM +0100, Benoit Fouet wrote:
> [...]
>   
>>> -{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, AV_CODEC_DEFAULT_BITRATE, INT_MIN, INT_MAX, V|A|E},
>>> +{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, AV_CODEC_DEFAULT_BITRATE, INT_MIN, INT_MAX, V|E},
>>> +{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, 64*1000, INT_MIN, INT_MAX, A|E},
>>>   
>>>       
>> why not a define, as for video one ?
>>     
>
> because it doesnt work
>
>
> [...]
>   
well, either you didn't understand me, or i didn't understand you right
now :)

>>>  
>>> -    av_opt_set_defaults(s);
>>> +    if(codec_type == CODEC_TYPE_AUDIO)
>>> +        flags= AV_OPT_FLAG_AUDIO_PARAM;
>>> +    else if(codec_type == CODEC_TYPE_VIDEO)
>>> +        flags= AV_OPT_FLAG_VIDEO_PARAM;
>>> +    av_opt_set_defaults2(s, flags);
>>>   
>>>       
>> no AV_OPT_FLAG_SUBTITLE_PARAM handling ?
>>     
>
> fixed
>
> ive also fixed the missing prototype in avcodec.h
>
> new patch attached
>
> with it
> -ab X -b Y also works like before with the exception that -ab is in bits/sec
>
> so are there any comments about the API changes? as they where what i
> actually would like feedback on, adding a AV_OPT_FLAG_SUBTITLE_PARAM
> later is trivial changing API is always problematic ...
>
> [...]
>   
>   
well, for what my opinion is worth, i find it cleaner that way, as only
the right flagged values in AVOption are passed to the context they
should belong to...

and about the patch itself, it works fine in here...

Ben





More information about the ffmpeg-devel mailing list