[FFmpeg-devel] [PATCH 12/17] avcodec/mpegaudioenc_template: Remove dead channel count check

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Sep 18 23:27:52 EEST 2022


The encoders using this have AVCodec.ch_layouts set, so that
this is checked generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mpegaudioenc_template.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavcodec/mpegaudioenc_template.c b/libavcodec/mpegaudioenc_template.c
index 67b8069102..396e8a4899 100644
--- a/libavcodec/mpegaudioenc_template.c
+++ b/libavcodec/mpegaudioenc_template.c
@@ -82,10 +82,6 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
     int i, v, table;
     float a;
 
-    if (channels <= 0 || channels > 2){
-        av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
-        return AVERROR(EINVAL);
-    }
     bitrate = bitrate / 1000;
     s->nb_channels = channels;
     avctx->frame_size = MPA_FRAME_SIZE;
-- 
2.34.1



More information about the ffmpeg-devel mailing list