diff mbox series

[FFmpeg-devel,06/17] avcodec/ac3enc: Remove always-false sample rate check

Message ID GV1P250MB0737DE1A9D2AE266D7AA3DF58F012@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 27a830c1d827b1bc61216000ec86eba0ca82e536
Headers show
Series [FFmpeg-devel,01/17] avcodec/ac3enc: Don't presume ch_layout to be AV_CHANNEL_ORDER_NATIVE | 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 April 7, 2024, 9:09 p.m. UTC
encode_preinit_audio() already checks that the sample rate
is among AVCodec.supported_samplerates.

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

Patch

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 272d2481d9..32aaf89ec1 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -2246,10 +2246,6 @@  static av_cold int validate_options(AC3EncodeContext *s)
         if ((ff_ac3_sample_rate_tab[i % 3] >> (i / 3)) == avctx->sample_rate)
             break;
     }
-    if (i > max_sr) {
-        av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
-        return AVERROR(EINVAL);
-    }
     s->sample_rate        = avctx->sample_rate;
     s->bit_alloc.sr_shift = i / 3;
     s->bit_alloc.sr_code  = i % 3;