Browse Source

avcodec/mpegaudiodec: Reset dither and mdct state

This makes the mp3 decoder produce the same result when repeatly flushing and decoding

Suggested-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
bd650ee318
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/mpegaudiodec_template.c

+ 2
- 0
libavcodec/mpegaudiodec_template.c View File

@@ -1705,7 +1705,9 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
static void mp_flush(MPADecodeContext *ctx)
{
memset(ctx->synth_buf, 0, sizeof(ctx->synth_buf));
memset(ctx->mdct_buf, 0, sizeof(ctx->mdct_buf));
ctx->last_buf_size = 0;
ctx->dither_state = 0;
}

static void flush(AVCodecContext *avctx)


Loading…
Cancel
Save