aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-07-04 08:58:06 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-07-11 15:14:27 +0200
commit9139edfdd346ea964ffac3310950c4b2c2f7906c (patch)
tree014905a651e2b838740f4c01e692596f0ac6431c
parent66f29ae9b6ae3d3d4e394b10bb4808c3e191844b (diff)
downloadffmpeg-9139edfdd346ea964ffac3310950c4b2c2f7906c.tar.gz
avcodec/opus/dec: Simplify resetting AVAudioFifo
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/opus/dec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/opus/dec.c b/libavcodec/opus/dec.c
index 92a9096ee1..29c490ae37 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);