ffmpeg | branch: master | James Almer <[email protected]> | Mon Aug 26 15:27:55 
2019 -0300| [33a53722dc5ec4fcb2cf9c5e8b23566ff3b50577] | committer: James Almer

avcodec/qtrle: add a flush() callback

The reference frame isn't valid after seeking

Reviewed-by: Paul B Mahol <[email protected]>
Signed-off-by: James Almer <[email protected]>

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

 libavcodec/qtrle.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 2c29547e5a..b3421d0b73 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -554,6 +554,14 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
     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;
@@ -572,5 +580,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,
 };

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to