aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qtrle.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-08-26 15:27:55 -0300
committerJames Almer <jamrial@gmail.com>2019-08-27 11:58:45 -0300
commit33a53722dc5ec4fcb2cf9c5e8b23566ff3b50577 (patch)
treebb8d29af3b8296cfc5aba7ba8b8f0f448eebbde3 /libavcodec/qtrle.c
parentaf70bfbeadc0c9b9215cf045ff2a6a31e8ac3a71 (diff)
downloadffmpeg-33a53722dc5ec4fcb2cf9c5e8b23566ff3b50577.tar.gz
avcodec/qtrle: add a flush() callback
The reference frame isn't valid after seeking Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/qtrle.c')
-rw-r--r--libavcodec/qtrle.c9
1 files changed, 9 insertions, 0 deletions
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,
};