[Ffmpeg-devel] [PATCH] accept only existing bitrates in amr.c

Benoit Fouet benoit.fouet
Mon Mar 5 13:18:07 CET 2007


Michael Niedermayer wrote:
> Hi
>
> On Mon, Mar 05, 2007 at 11:18:32AM +0100, Benoit Fouet wrote:
>   
>> Hi,
>>
>> now that audio bitrate is handled the same way as video bitrate, we can
>> get rid of the workaround in amr codecs.
>>     
>
> [...]
>
> [...]
>   
>> -            return(rates[i].mode);
>> +            *mode=rates[i].mode;
>> +            return 0;
>>     
>
> why not return the mode like before?
>
> [...]
>   
>   
well, in the amr nb case, it's an enum, and so we cannot do it (wel, we
can, but i don't think it's clean) so i changed it for the amr wb case
too...
of course, this can be changed to something like:

int getMode(int bitrate) /* or enum Mode getMode(int bitrate) for amr nb */
{
    if mode exists
        return(mode);
    else
        return -1;
}
...
{
    if((mode=getMode(bitrate))<0)
...
}

i don't really care, i'll do as you wish...

Ben





More information about the ffmpeg-devel mailing list