summaryrefslogtreecommitdiff
path: root/libavcodec/cngenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-05-07 07:20:32 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:40 -0300
commitcdde7fe41599ad554d8fba9e84f863a63f298e21 (patch)
tree7ef9b02d19f2ee70ea79fa0117d39d5dd615dd24 /libavcodec/cngenc.c
parent1d2f7e0ea3f037e2310bfd493b3427c42877e0a4 (diff)
downloadffmpeg-cdde7fe41599ad554d8fba9e84f863a63f298e21.tar.gz
cng: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/cngenc.c')
-rw-r--r--libavcodec/cngenc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c
index 830311f955..d77bbac40e 100644
--- a/libavcodec/cngenc.c
+++ b/libavcodec/cngenc.c
@@ -48,11 +48,6 @@ static av_cold int cng_encode_init(AVCodecContext *avctx)
CNGContext *p = avctx->priv_data;
int ret;
- if (avctx->channels != 1) {
- av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
- return AVERROR(EINVAL);
- }
-
avctx->frame_size = 640;
p->order = 10;
if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
@@ -113,5 +108,6 @@ const AVCodec ff_comfortnoise_encoder = {
.close = cng_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
+ .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};