Hi!

I believe attached patch fixes ticket #8649, a regression reported
yesterday on irc, I don't see anymore (and forgot) the irc name of the
original reporter, that's why it is missing in the ticket and the
patch.
Improvements for the commit message welcome.

Please comment, Carl Eugen
From b16b0ad02510259fe3ce536144eb8ddec4f65f7b Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Sat, 2 May 2020 10:09:01 +0200
Subject: [PATCH] lavc/opus: Reset alloc_trim when doing decoder bit-allocation.

Fixes ticket #8649.
---
 libavcodec/opus.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index f74278a7e3..0e599783c3 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -613,6 +613,8 @@ void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode)
     }
 
     /* Allocation trim */
+    if (!encode)
+        f->alloc_trim = 5;
     if (opus_rc_tell_frac(rc) + (6 << 3) <= tbits_8ths)
         if (encode)
             ff_opus_rc_enc_cdf(rc, f->alloc_trim, ff_celt_model_alloc_trim);
-- 
2.24.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to