[FFmpeg-cvslog] avcodec/opusdec: Remove always-true check

Andreas Rheinhardt git at videolan.org
Fri Jan 1 01:07:17 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sat Dec 26 13:09:49 2020 +0100| [2825ed4e26f7683f0cf6baed0bbc62b095652ff9] | committer: Andreas Rheinhardt

avcodec/opusdec: Remove always-true check

The celt_delay AVAudioFifo is always allocated during init, so checking
for its existence in .flush is unnecessary.

Reviewed-by: Lynne <dev at lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2825ed4e26f7683f0cf6baed0bbc62b095652ff9
---

 libavcodec/opusdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index a08758d25d..86a3181e9d 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -576,8 +576,7 @@ static av_cold void opus_decode_flush(AVCodecContext *ctx)
         memset(&s->packet, 0, sizeof(s->packet));
         s->delayed_samples = 0;
 
-        if (s->celt_delay)
-            av_audio_fifo_drain(s->celt_delay, av_audio_fifo_size(s->celt_delay));
+        av_audio_fifo_drain(s->celt_delay, av_audio_fifo_size(s->celt_delay));
         swr_close(s->swr);
 
         av_audio_fifo_drain(c->sync_buffers[i], av_audio_fifo_size(c->sync_buffers[i]));



More information about the ffmpeg-cvslog mailing list