Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <ffmpegagent-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/opus/dec: Simplify resetting AVAudioFifo
Date: Fri, 04 Jul 2025 10:35:21 +0000
Message-ID: <6052128570b267847e5ef5d48c90009ad4b0f139.1751625321.git.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.105.ffstaging.FFmpeg.1751625321.ffmpegagent@gmail.com>

From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/opus/dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/opus/dec.c b/libavcodec/opus/dec.c
index b0e149e636..3118f2b99c 100644
--- a/libavcodec/opus/dec.c
+++ b/libavcodec/opus/dec.c
@@ -323,7 +323,7 @@ static int opus_decode_frame(OpusStreamContext *s, const uint8_t *data, int size
             } else {
                 av_log(s->avctx, AV_LOG_WARNING,
                        "Spurious CELT delay samples present.\n");
-                av_audio_fifo_drain(s->celt_delay, delay_samples);
+                av_audio_fifo_reset(s->celt_delay);
                 if (s->avctx->err_recognition & AV_EF_EXPLODE)
                     return AVERROR_BUG;
             }
@@ -640,10 +640,10 @@ static av_cold void opus_decode_flush(AVCodecContext *ctx)
         memset(&s->packet, 0, sizeof(s->packet));
         s->delayed_samples = 0;
 
-        av_audio_fifo_drain(s->celt_delay, av_audio_fifo_size(s->celt_delay));
+        av_audio_fifo_reset(s->celt_delay);
         swr_close(s->swr);
 
-        av_audio_fifo_drain(s->sync_buffer, av_audio_fifo_size(s->sync_buffer));
+        av_audio_fifo_reset(s->sync_buffer);
 
         ff_silk_flush(s->silk);
         ff_celt_flush(s->celt);
-- 
ffmpeg-codebot
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

      parent reply	other threads:[~2025-07-04 10:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 10:35 [FFmpeg-devel] [PATCH 0/4] Opus ffmpegagent
2025-07-04 10:35 ` [FFmpeg-devel] [PATCH 1/4] avcodec/opus/dec: Don't use outdated size Andreas Rheinhardt
2025-07-04 10:35 ` [FFmpeg-devel] [PATCH 2/4] avcodec/opus/dec: Remove unused parameters Andreas Rheinhardt
2025-07-04 10:35 ` [FFmpeg-devel] [PATCH 3/4] avcodec/opus/dec: Don't call function multiple times in FFMAX Andreas Rheinhardt
2025-07-04 10:35 ` Andreas Rheinhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6052128570b267847e5ef5d48c90009ad4b0f139.1751625321.git.ffmpegagent@gmail.com \
    --to=ffmpegagent-at-gmail.com@ffmpeg.org \
    --cc=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git