summaryrefslogtreecommitdiff
path: root/codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'codec.c')
-rw-r--r--codec.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/codec.c b/codec.c
index 790f2e0..158b1eb 100644
--- a/codec.c
+++ b/codec.c
@@ -561,6 +561,16 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
}
}
+/**
+** Flush the video decoder.
+**
+** @param decoder video decoder data
+*/
+void CodecVideoFlushBuffers(VideoDecoder * decoder)
+{
+ avcodec_flush_buffers(decoder->VideoCtx);
+}
+
//----------------------------------------------------------------------------
// Audio
//----------------------------------------------------------------------------
@@ -738,9 +748,11 @@ void CodecAudioDecode(AudioDecoder * audio_decoder, const AVPacket * avpkt)
spkt->pts = avpkt->pts;
spkt->dts = avpkt->dts;
#endif
+#ifdef DEBUG
if (!audio_decoder->AudioParser) {
Fatal(_("codec: internal error parser freeded while running\n"));
}
+#endif
audio_ctx = audio_decoder->AudioCtx;
index = 0;
@@ -1026,6 +1038,17 @@ void CodecAudioDecode(AudioDecoder * audio_decoder, const AVPacket * avpkt)
#endif
+/**
+** Flush the audio decoder.
+**
+** @param decoder audio decoder data
+*/
+void CodecAudioFlushBuffers(AudioDecoder * decoder)
+{
+ // FIXME: reset audio parser
+ avcodec_flush_buffers(decoder->AudioCtx);
+}
+
//----------------------------------------------------------------------------
// Codec
//----------------------------------------------------------------------------