qdm2: convert to new channel layout API

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
release/5.1
Anton Khirnov 12 years ago committed by James Almer
parent 884a97de69
commit 063e5f1fa9
  1. 6
      libavcodec/qdm2.c

@ -1687,13 +1687,13 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
bytestream2_skip(&gb, 4); bytestream2_skip(&gb, 4);
avctx->channels = s->nb_channels = s->channels = bytestream2_get_be32(&gb); s->nb_channels = s->channels = bytestream2_get_be32(&gb);
if (s->channels <= 0 || s->channels > MPA_MAX_CHANNELS) { if (s->channels <= 0 || s->channels > MPA_MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n"); av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
avctx->channel_layout = avctx->channels == 2 ? AV_CH_LAYOUT_STEREO : av_channel_layout_uninit(&avctx->ch_layout);
AV_CH_LAYOUT_MONO; av_channel_layout_default(&avctx->ch_layout, s->channels);
avctx->sample_rate = bytestream2_get_be32(&gb); avctx->sample_rate = bytestream2_get_be32(&gb);
avctx->bit_rate = bytestream2_get_be32(&gb); avctx->bit_rate = bytestream2_get_be32(&gb);

Loading…
Cancel
Save