From bd650ee318872f9712b496bdba532fed40a0108a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 5 Jun 2014 21:23:31 +0200 Subject: 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 Signed-off-by: Michael Niedermayer --- libavcodec/mpegaudiodec_template.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 6ae34ae..05237070 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -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) -- cgit v1.1