Revision d804784d libavcodec/tta.c

View differences:

libavcodec/tta.c
205 205
    return ret;
206 206
}
207 207

  
208
static const int64_t tta_channel_layouts[7] = {
209
    AV_CH_LAYOUT_STEREO,
210
    AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
211
    AV_CH_LAYOUT_QUAD,
212
    0,
213
    AV_CH_LAYOUT_5POINT1_BACK,
214
    AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER,
215
    AV_CH_LAYOUT_7POINT1_WIDE
216
};
217

  
208 218
static av_cold int tta_decode_init(AVCodecContext * avctx)
209 219
{
210 220
    TTAContext *s = avctx->priv_data;
......
234 244
        }
235 245
        s->is_float = (s->flags == FORMAT_FLOAT);
236 246
        avctx->channels = s->channels = get_bits(&s->gb, 16);
247
        if (s->channels > 1 && s->channels < 9)
248
            avctx->channel_layout = tta_channel_layouts[s->channels-2];
237 249
        avctx->bits_per_coded_sample = get_bits(&s->gb, 16);
238 250
        s->bps = (avctx->bits_per_coded_sample + 7) / 8;
239 251
        avctx->sample_rate = get_bits_long(&s->gb, 32);

Also available in: Unified diff