diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-05-07 07:20:32 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:41 -0300 |
commit | c21e1492e35599a52d15332db40731b11e59d3f6 (patch) | |
tree | 75e7c24a1d693bcd8192508735aefa05d73764a1 | |
parent | 5e257c1f7bf8bf277144b21200f3c6ed9a077af0 (diff) | |
download | ffmpeg-c21e1492e35599a52d15332db40731b11e59d3f6.tar.gz |
g722: 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>
-rw-r--r-- | libavcodec/g722dec.c | 4 | ||||
-rw-r--r-- | libavcodec/g722enc.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c index 5ca0d0e2b1..879ea296cb 100644 --- a/libavcodec/g722dec.c +++ b/libavcodec/g722dec.c @@ -59,8 +59,8 @@ static av_cold int g722_decode_init(AVCodecContext * avctx) { G722Context *c = avctx->priv_data; - avctx->channels = 1; - avctx->channel_layout = AV_CH_LAYOUT_MONO; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; avctx->sample_fmt = AV_SAMPLE_FMT_S16; c->band[0].scale_factor = 8; diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index 75b926ef8e..6010a6d5ae 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -381,6 +381,11 @@ const AVCodec ff_adpcm_g722_encoder = { .close = g722_encode_close, .encode2 = g722_encode_frame, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, +#if FF_API_OLD_CHANNEL_LAYOUT .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, +#endif + .ch_layouts = (const AVChannelLayout[]){ + AV_CHANNEL_LAYOUT_MONO, { 0 } + }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; |