[FFmpeg-devel] [PATCH] avcodec/qtrle: add a flush() callback
James Almer
jamrial at gmail.com
Mon Aug 26 21:27:55 EEST 2019
The reference frame isn't valid after seeking
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavcodec/qtrle.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 3255c64063..1021986f01 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -571,6 +571,14 @@ done:
return avpkt->size;
}
+static void qtrle_decode_flush(AVCodecContext *avctx)
+{
+ QtrleContext *s = avctx->priv_data;
+
+ memset(s->pal, 0, sizeof(s->pal));
+ av_frame_unref(s->frame);
+}
+
static av_cold int qtrle_decode_end(AVCodecContext *avctx)
{
QtrleContext *s = avctx->priv_data;
@@ -589,5 +597,6 @@ AVCodec ff_qtrle_decoder = {
.init = qtrle_decode_init,
.close = qtrle_decode_end,
.decode = qtrle_decode_frame,
+ .flush = qtrle_decode_flush,
.capabilities = AV_CODEC_CAP_DR1,
};
--
2.22.0
More information about the ffmpeg-devel
mailing list