Commit 33a53722 authored by James Almer's avatar James Almer

avcodec/qtrle: add a flush() callback

The reference frame isn't valid after seeking
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent af70bfbe
......@@ -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,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment