dvaudio: convert to new channel layout API

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Anton Khirnov 2019-05-29 08:34:13 +02:00 committed by James Almer
parent 89f9a9061e
commit 502f7240fa
1 changed files with 2 additions and 6 deletions

View File

@ -36,11 +36,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
DVAudioContext *s = avctx->priv_data;
int i;
if (avctx->channels != 2) {
av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
return AVERROR(EINVAL);
}
if (avctx->codec_tag == 0x0215) {
s->block_size = 7200;
} else if (avctx->codec_tag == 0x0216) {
@ -55,7 +50,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->is_pal = s->block_size == 8640;
s->is_12bit = avctx->bits_per_coded_sample == 12;
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
av_channel_layout_uninit(&avctx->ch_layout);
avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
for (i = 0; i < FF_ARRAY_ELEMS(s->shuffle); i++) {
const unsigned a = s->is_pal ? 18 : 15;