diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-08-29 18:28:49 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-08-29 18:31:59 +0200 |
commit | 0067da587a08d32c1eaafa6d10eb27660f03c07a (patch) | |
tree | eba06d4dc8462c00cac7aad68e1bd55aeb0caf2f | |
parent | 59e651c0524450e2acb0cfb2838cd989e806899b (diff) | |
download | ffmpeg-0067da587a08d32c1eaafa6d10eb27660f03c07a.tar.gz |
avcodec/msrle: add a flush() callback
The reference frame isn't valid after seeking.
-rw-r--r-- | libavcodec/msrle.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 61bc02df04..b83b3d2a41 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -148,6 +148,13 @@ static int msrle_decode_frame(AVCodecContext *avctx, return buf_size; } +static void msrle_decode_flush(AVCodecContext *avctx) +{ + MsrleContext *s = avctx->priv_data; + + av_frame_unref(s->frame); +} + static av_cold int msrle_decode_end(AVCodecContext *avctx) { MsrleContext *s = avctx->priv_data; @@ -167,5 +174,6 @@ AVCodec ff_msrle_decoder = { .init = msrle_decode_init, .close = msrle_decode_end, .decode = msrle_decode_frame, + .flush = msrle_decode_flush, .capabilities = AV_CODEC_CAP_DR1, }; |