[FFmpeg-cvslog] avcodec/qtrle: add a flush() callback
James Almer
git at videolan.org
Tue Aug 27 17:59:30 EEST 2019
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | 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 <onemda at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>
> 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,
};
More information about the ffmpeg-cvslog
mailing list