From 6f2c64fd03a17c804334df8b8406bf7dd1b92c88 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 May 2015 14:16:36 +0200 Subject: [PATCH] dvdsubdec: implement flushing This is needed for proper operation with seeking. Signed-off-by: Michael Niedermayer --- libavcodec/dvdsubdec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index a87a3bcdd4..7120f10a53 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -719,10 +719,15 @@ static av_cold int dvdsub_init(AVCodecContext *avctx) return 1; } -static av_cold int dvdsub_close(AVCodecContext *avctx) +static void dvdsub_flush(AVCodecContext *avctx) { DVDSubContext *ctx = avctx->priv_data; ctx->buf_size = 0; +} + +static av_cold int dvdsub_close(AVCodecContext *avctx) +{ + dvdsub_flush(avctx); return 0; } @@ -749,6 +754,7 @@ AVCodec ff_dvdsub_decoder = { .priv_data_size = sizeof(DVDSubContext), .init = dvdsub_init, .decode = dvdsub_decode, + .flush = dvdsub_flush, .close = dvdsub_close, .priv_class = &dvdsub_class, };