aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-05 21:23:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-05 21:25:51 +0200
commitbd650ee318872f9712b496bdba532fed40a0108a (patch)
treeb2a27e91a6d976cae07d152dd221eca77ff645fa
parentccff45a0d3c981edc97078885e2a630e0436ce31 (diff)
downloadffmpeg-bd650ee318872f9712b496bdba532fed40a0108a.tar.gz
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>
-rw-r--r--libavcodec/mpegaudiodec_template.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index 6ae34ae2b1..05237070ea 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)