]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/adpcm_aica: reset state in flush callback
authorZane van Iperen <zane@zanevaniperen.com>
Tue, 23 Mar 2021 10:55:17 +0000 (20:55 +1000)
committerZane van Iperen <zane@zanevaniperen.com>
Thu, 25 Mar 2021 02:51:08 +0000 (12:51 +1000)
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
libavcodec/adpcm.c

index b145622f4fbd2666654e09132f7d1fb41b69a6dd..b0354065502ff94604eb97cccfedeabb8e4a03e6 100644 (file)
@@ -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;