changeset 4203:14250f6ff483 libavcodec

reset internal buffer during seeking
author michael
date Tue, 14 Nov 2006 20:39:20 +0000
parents af24e0fd0d1b
children 672724df5c9a
files mpegaudiodec.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mpegaudiodec.c	Tue Nov 14 20:35:15 2006 +0000
+++ b/mpegaudiodec.c	Tue Nov 14 20:39:20 2006 +0000
@@ -2590,6 +2590,11 @@
     return buf_size;
 }
 
+static void flush(AVCodecContext *avctx){
+    MPADecodeContext *s = avctx->priv_data;
+    s->last_buf_size= 0;
+}
+
 #ifdef CONFIG_MP3ADU_DECODER
 static int decode_frame_adu(AVCodecContext * avctx,
                         void *data, int *data_size,
@@ -2825,6 +2830,7 @@
     NULL,
     decode_frame,
     CODEC_CAP_PARSE_ONLY,
+    .flush= flush,
 };
 #endif
 #ifdef CONFIG_MP3ADU_DECODER
@@ -2839,6 +2845,7 @@
     NULL,
     decode_frame_adu,
     CODEC_CAP_PARSE_ONLY,
+    .flush= flush,
 };
 #endif
 #ifdef CONFIG_MP3ON4_DECODER
@@ -2852,6 +2859,6 @@
     NULL,
     decode_close_mp3on4,
     decode_frame_mp3on4,
-    0
+    .flush= flush,
 };
 #endif