diff mbox series

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

Message ID GV1P250MB0737EB31A33915B7E24D5E708F4A9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 17366d6128c7c3e3781442cfd1e84e4ec5b6f20e
Headers show
Series [FFmpeg-devel,01/17] avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 18, 2022, 8:27 p.m. UTC
The encoders using this have AVCodec.ch_layouts set, so that
this is checked generically.

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

Patch

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;