| @@ -48,11 +48,6 @@ static av_cold int cng_encode_init(AVCodecContext *avctx) · 47 unmodified lines |
| 48 | CNGContext *p = avctx->priv_data; | 48 | CNGContext *p = avctx->priv_data; |
| 49 | int ret; | 49 | int ret; |
| 50 | | 50 | |
| 51 | if (avctx->channels != 1) { | | |
| 52 | av_log(avctx, AV_LOG_ERROR, "Only mono supported\n"); | | |
| 53 | return AVERROR(EINVAL); | | |
| 54 | } | | |
| 55 | | | |
| 56 | avctx->frame_size = 640; | 51 | avctx->frame_size = 640; |
| 57 | p->order = 10; | 52 | p->order = 10; |
| 58 | if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0) | 53 | 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 = { · 54 unmodified lines |
| 113 | .close = cng_encode_close, | 108 | .close = cng_encode_close, |
| 114 | .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | 109 | .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, |
| 115 | AV_SAMPLE_FMT_NONE }, | 110 | AV_SAMPLE_FMT_NONE }, |
| | 111 | .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, |
| 116 | .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, | 112 | .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, |
| 117 | }; | 113 | }; |