Revision 8d09fc19 libavcodec/binkaudio.c

View differences:

libavcodec/binkaudio.c
81 81
    } else {
82 82
        frame_len_bits = 11;
83 83
    }
84
    s->frame_len = 1 << frame_len_bits;
85 84

  
86 85
    if (avctx->channels > MAX_CHANNELS) {
87 86
        av_log(avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels);
......
91 90
    if (avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT) {
92 91
        // audio is already interleaved for the RDFT format variant
93 92
        sample_rate  *= avctx->channels;
94
        s->frame_len *= avctx->channels;
95 93
        s->channels = 1;
96
        if (avctx->channels == 2)
97
            frame_len_bits++;
94
        frame_len_bits += av_log2(avctx->channels);
98 95
    } else {
99 96
        s->channels = avctx->channels;
100 97
    }
101 98

  
99
    s->frame_len     = 1 << frame_len_bits;
102 100
    s->overlap_len   = s->frame_len / 16;
103 101
    s->block_size    = (s->frame_len - s->overlap_len) * s->channels;
104 102
    sample_rate_half = (sample_rate + 1) / 2;

Also available in: Unified diff