[FFmpeg-cvslog] mpc8: add a flush function

Justin Ruggles git at videolan.org
Tue Aug 7 22:03:51 CEST 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Aug  6 13:06:25 2012 -0400| [fdbeae449030543525ce45b048c0241643ce02ef] | committer: Justin Ruggles

mpc8: add a flush function

Ensures that the next frame decoded after seeking will be decoded as a
keyframe.

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

 libavcodec/mpc8.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index f2e8342..639adaa 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -420,6 +420,12 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
     return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
 }
 
+static av_cold void mpc8_decode_flush(AVCodecContext *avctx)
+{
+    MPCContext *c = avctx->priv_data;
+    c->cur_frame = 0;
+}
+
 AVCodec ff_mpc8_decoder = {
     .name           = "mpc8",
     .type           = AVMEDIA_TYPE_AUDIO,
@@ -427,6 +433,7 @@ AVCodec ff_mpc8_decoder = {
     .priv_data_size = sizeof(MPCContext),
     .init           = mpc8_decode_init,
     .decode         = mpc8_decode_frame,
+    .flush          = mpc8_decode_flush,
     .capabilities   = CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("Musepack SV8"),
 };



More information about the ffmpeg-cvslog mailing list