summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-23 15:08:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-23 15:08:55 +0200
commit79ec524ff52aa641896f755b63e933ab2877763c (patch)
treed3750e2e5d798ea76e4673263cdfd05a93c3f3b4 /libavcodec/mpegaudiodec.c
parent35ce42e07029b3af62f652a53719fee99bb7a5aa (diff)
parentec444c84cfd30ef34a4e7b4ec7ee77d7e5250d25 (diff)
Merge commit 'ec444c84cfd30ef34a4e7b4ec7ee77d7e5250d25'
* commit 'ec444c84cfd30ef34a4e7b4ec7ee77d7e5250d25': mpegaudiodec: Fix buffer handling on random access mpegaudio: Refactor mp3on4 flush function fate: Add dependencies for audio tests fate: cosmetics: Group idct8x8 test together with all other libavcodec tests fate: More fine-grained dependencies for libavcodec test programs Conflicts: tests/fate/audio.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 5a39bdce33..b010af6b3e 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1713,11 +1713,15 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
return buf_size;
}
+static void mp_flush(MPADecodeContext *ctx)
+{
+ memset(ctx->synth_buf, 0, sizeof(ctx->synth_buf));
+ ctx->last_buf_size = 0;
+}
+
static void flush(AVCodecContext *avctx)
{
- MPADecodeContext *s = avctx->priv_data;
- memset(s->synth_buf, 0, sizeof(s->synth_buf));
- s->last_buf_size = 0;
+ mp_flush(avctx->priv_data);
}
#if CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER
@@ -1908,11 +1912,8 @@ static void flush_mp3on4(AVCodecContext *avctx)
int i;
MP3On4DecodeContext *s = avctx->priv_data;
- for (i = 0; i < s->frames; i++) {
- MPADecodeContext *m = s->mp3decctx[i];
- memset(m->synth_buf, 0, sizeof(m->synth_buf));
- m->last_buf_size = 0;
- }
+ for (i = 0; i < s->frames; i++)
+ mp_flush(s->mp3decctx[i]);
}