1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

libilbc: convert to new channel layout API

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Anton Khirnov 2013-05-07 07:20:32 +02:00 committed by James Almer
parent 353e4d4219
commit 06ed1927b1

View File

@ -78,8 +78,8 @@ static av_cold int ilbc_decode_init(AVCodecContext *avctx)
WebRtcIlbcfix_InitDecode(&s->decoder, mode, s->enhance); WebRtcIlbcfix_InitDecode(&s->decoder, mode, s->enhance);
avctx->channels = 1; av_channel_layout_uninit(&avctx->ch_layout);
avctx->channel_layout = AV_CH_LAYOUT_MONO; avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
avctx->sample_rate = 8000; avctx->sample_rate = 8000;
avctx->sample_fmt = AV_SAMPLE_FMT_S16; avctx->sample_fmt = AV_SAMPLE_FMT_S16;
@ -161,7 +161,7 @@ static av_cold int ilbc_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (avctx->channels != 1) { if (avctx->ch_layout.nb_channels != 1) {
av_log(avctx, AV_LOG_ERROR, "Only mono supported\n"); av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }