1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-29 22:00:58 +02:00

libopencore-amr: 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 9b3130c886
commit e0bb126de8

View File

@ -38,13 +38,13 @@ static int amr_decode_fix_avctx(AVCodecContext *avctx)
if (!avctx->sample_rate) if (!avctx->sample_rate)
avctx->sample_rate = 8000 * is_amr_wb; avctx->sample_rate = 8000 * is_amr_wb;
if (avctx->channels > 1) { if (avctx->ch_layout.nb_channels > 1) {
avpriv_report_missing_feature(avctx, "multi-channel AMR"); avpriv_report_missing_feature(avctx, "multi-channel AMR");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
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_fmt = AV_SAMPLE_FMT_S16; avctx->sample_fmt = AV_SAMPLE_FMT_S16;
return 0; return 0;
} }
@ -201,7 +201,7 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
} }
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(ENOSYS); return AVERROR(ENOSYS);
} }