avcodec/ac3enc: Remove always-false sample rate check

encode_preinit_audio() already checks that the sample rate
is among AVCodec.supported_samplerates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-04-07 14:30:13 +02:00
parent e878ec7eb2
commit 27a830c1d8
1 changed files with 0 additions and 4 deletions

View File

@ -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;