[FFmpeg-cvslog] avcodec/mpegaudiodec: Reset dither and mdct state

Michael Niedermayer git at videolan.org
Thu Jun 5 21:33:22 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jun  5 21:23:31 2014 +0200| [bd650ee318872f9712b496bdba532fed40a0108a] | committer: Michael Niedermayer

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 at chromium.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd650ee318872f9712b496bdba532fed40a0108a
---

 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)



More information about the ffmpeg-cvslog mailing list