Commit 302ede9a29 for ffmpeg
commit 302ede9a290197e8fe237470d4d33ca336a7a9ae
Author: James Almer <jamrial@gmail.com>
Date: Wed Nov 4 10:26:39 2026 -0300
libavcodec/opus/parser: don't override sample rate if it's set
Signed-off-by: James Almer <jamrial@gmail.com>
diff --git a/libavcodec/opus/parser.c b/libavcodec/opus/parser.c
index 7cecac8857..be04cf78bd 100644
--- a/libavcodec/opus/parser.c
+++ b/libavcodec/opus/parser.c
@@ -177,7 +177,8 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
ParseContext *pc = &s->pc;
int next, header_len = 0;
- avctx->sample_rate = 48000;
+ if (!avctx->sample_rate)
+ avctx->sample_rate = 48000;
if (avctx->extradata && !s->extradata_parsed) {
if (ff_opus_parse_extradata(avctx, &s->ctx) < 0) {