[FFmpeg-cvslog] imc: flush decoder

Michael Niedermayer git at videolan.org
Sun Nov 25 23:05:18 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 25 22:48:18 2012 +0100| [b5b9686615e225e2f0c4f3309ea0e0ed64333959] | committer: Michael Niedermayer

imc: flush decoder

Fixes Ticket1899

Based on code by ami_stuff
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/imc.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index fdf8e2c..feca07c 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -986,6 +986,14 @@ static av_cold int imc_decode_close(AVCodecContext * avctx)
     return 0;
 }
 
+static av_cold void flush(AVCodecContext *avctx)
+{
+    IMCContext *q = avctx->priv_data;
+
+    q->chctx[0].decoder_reset =
+    q->chctx[1].decoder_reset = 1;
+}
+
 #if CONFIG_IMC_DECODER
 AVCodec ff_imc_decoder = {
     .name           = "imc",
@@ -995,6 +1003,7 @@ AVCodec ff_imc_decoder = {
     .init           = imc_decode_init,
     .close          = imc_decode_close,
     .decode         = imc_decode_frame,
+    .flush          = flush,
     .capabilities   = CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"),
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
@@ -1010,6 +1019,7 @@ AVCodec ff_iac_decoder = {
     .init           = imc_decode_init,
     .close          = imc_decode_close,
     .decode         = imc_decode_frame,
+    .flush          = flush,
     .capabilities   = CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"),
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,



More information about the ffmpeg-cvslog mailing list