1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00

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>
This commit is contained in:
James Almer 2019-08-26 15:27:55 -03:00
parent af70bfbead
commit 33a53722dc

View File

@ -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,
};