aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-10-31 17:09:15 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-11-15 22:59:11 +0100
commitbf6c500cff88564f3e47d8deb88bd3cd3526f812 (patch)
tree2710e920c9bdfccc999c398f2261bd16b937d76e
parent752039a9ebb19c883201333f1d66a8f143108c44 (diff)
downloadffmpeg-bf6c500cff88564f3e47d8deb88bd3cd3526f812.tar.gz
libavcodec/flacenc: Enable sample rates > 655350 Hz
Also, make use of the full sample rate code table Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/flacenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 5d8c3f82be..bca71b3780 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -299,7 +299,7 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
/* find samplerate in table */
if (freq < 1)
return AVERROR(EINVAL);
- for (i = 4; i < 12; i++) {
+ for (i = 1; i < 12; i++) {
if (freq == ff_flac_sample_rate_table[i]) {
s->samplerate = ff_flac_sample_rate_table[i];
s->sr_code[0] = i;
@@ -318,6 +318,9 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
} else if (freq < 65535) {
s->sr_code[0] = 13;
s->sr_code[1] = freq;
+ } else if (freq < 1048576) {
+ s->sr_code[0] = 0;
+ s->sr_code[1] = 0;
} else {
av_log(avctx, AV_LOG_ERROR, "%d Hz not supported\n", freq);
return AVERROR(EINVAL);