summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-10-22 16:55:23 +0200
committerDiego Biurrun <diego@biurrun.de>2012-10-23 10:52:25 +0200
commit2f17f265ed79766a561ed6542509f5b665658a7c (patch)
treeb6a69ddb58b9cbe2bb565fefdf4e2e107b23da85
parent88bdec03b986b6b442f02c761879ea7398603c9f (diff)
mpegaudio: Refactor mp3on4 flush function
-rw-r--r--libavcodec/mpegaudiodec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 80acdadc48..9c5ef265c1 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1681,11 +1681,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
@@ -1875,11 +1879,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]);
}