Browse Source

avcodec/adpcm_aica: reset state in flush callback

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
(cherry picked from commit efb58ec8f9)
tags/n4.4
Zane van Iperen 4 years ago
parent
commit
2057068495
No known key found for this signature in database GPG Key ID: 68616B2D8AC4DCC5
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      libavcodec/adpcm.c

+ 5
- 5
libavcodec/adpcm.c View File

@@ -1811,11 +1811,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
} }
break; break;
case AV_CODEC_ID_ADPCM_AICA: 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++) { for (channel = 0; channel < avctx->channels; channel++) {
samples = samples_p[channel]; samples = samples_p[channel];
for (n = nb_samples >> 1; n > 0; n--) { for (n = nb_samples >> 1; n > 0; n--) {
@@ -2116,6 +2111,11 @@ static void adpcm_flush(AVCodecContext *avctx)
ADPCMDecodeContext *c = avctx->priv_data; ADPCMDecodeContext *c = avctx->priv_data;


switch(avctx->codec_id) { 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: case AV_CODEC_ID_ADPCM_ZORK:
for (int channel = 0; channel < avctx->channels; channel++) { for (int channel = 0; channel < avctx->channels; channel++) {
c->status[channel].predictor = 0; c->status[channel].predictor = 0;


Loading…
Cancel
Save