On 02/25/2012 12:58 AM, Anton Khirnov wrote:

> 
> On Wed, 22 Feb 2012 21:45:06 -0500, Justin Ruggles <[email protected]> 
> wrote:
>> ---
>>  libavcodec/ac3enc.c               |   11 +++++++++++
>>  libavcodec/ac3enc_fixed.c         |    1 +
>>  libavcodec/ac3enc_float.c         |    1 +
>>  libavcodec/ac3enc_opts_template.c |    5 +++++
>>  libavcodec/eac3enc.c              |    1 +
>>  5 files changed, 19 insertions(+), 0 deletions(-)
>>
> 
> \o/
> 
>> diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
>> index 669be23..967c1bd 100644
>> --- a/libavcodec/ac3enc.c
>> +++ b/libavcodec/ac3enc.c
>> @@ -2141,6 +2141,17 @@ static av_cold int validate_options(AC3EncodeContext 
>> *s)
>>      s->bit_alloc.sr_code  = i % 3;
>>      s->bitstream_id       = s->eac3 ? 16 : 8 + s->bit_alloc.sr_shift;
>>  
>> +    /* select a default bit rate if not set by the user */
>> +    if (!avctx->bit_rate) {
>> +        switch (s->fbw_channels) {
>> +        case 1: avctx->bit_rate =  96000; break;
>> +        case 2: avctx->bit_rate = 192000; break;
>> +        case 3: avctx->bit_rate = 320000; break;
>> +        case 4: avctx->bit_rate = 384000; break;
>> +        case 5: avctx->bit_rate = 448000; break;
>> +        }
>> +    }
> 
> There can't be more than 5?
> AC3_MAX_CHANNELS is defined to 7


full-bandwidth channels. that excludes the LFE channel and coupling channel.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to