[FFmpeg-cvslog] avcodec/adpcm_aica: reset state in flush callback

Zane van Iperen git at videolan.org
Thu Mar 25 08:38:49 EET 2021


ffmpeg | branch: release/4.4 | Zane van Iperen <zane at zanevaniperen.com> | Tue Mar 23 20:55:17 2021 +1000| [2057068495496065a855e57ff103f1b7288405f6] | committer: Zane van Iperen

avcodec/adpcm_aica: reset state in flush callback

Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>
(cherry picked from commit efb58ec8f9c26f0b779a05df15782dfe002aaacc)

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

 libavcodec/adpcm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index b145622f4f..b035406550 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1811,11 +1811,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
         }
         break;
     case AV_CODEC_ID_ADPCM_AICA:
-        if (!c->has_status) {
-            for (channel = 0; channel < avctx->channels; channel++)
-                c->status[channel].step = 0;
-            c->has_status = 1;
-        }
         for (channel = 0; channel < avctx->channels; channel++) {
             samples = samples_p[channel];
             for (n = nb_samples >> 1; n > 0; n--) {
@@ -2116,6 +2111,11 @@ static void adpcm_flush(AVCodecContext *avctx)
     ADPCMDecodeContext *c = avctx->priv_data;
 
     switch(avctx->codec_id) {
+    case AV_CODEC_ID_ADPCM_AICA:
+        for (int channel = 0; channel < avctx->channels; channel++)
+            c->status[channel].step = 0;
+        break;
+
     case AV_CODEC_ID_ADPCM_ZORK:
         for (int channel = 0; channel < avctx->channels; channel++) {
             c->status[channel].predictor  = 0;



More information about the ffmpeg-cvslog mailing list