[FFmpeg-devel] [PATCH 1/2] lavc/ccaption_dec: flush context on seek
Aman Gupta
ffmpeg at tmm1.net
Sat Jan 9 23:55:00 CET 2016
From: Aman Gupta <aman at tmm1.net>
---
libavcodec/ccaption_dec.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index fc6431b..8bef771 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -165,6 +165,24 @@ static av_cold int close_decoder(AVCodecContext *avctx)
return 0;
}
+static void flush_decoder(AVCodecContext *avctx)
+{
+ CCaptionSubContext *ctx = avctx->priv_data;
+ ctx->screen[0].row_used = 0;
+ ctx->screen[1].row_used = 0;
+ ctx->prev_cmd[0] = 0;
+ ctx->prev_cmd[1] = 0;
+ ctx->mode = CCMODE_ROLLUP;
+ ctx->rollup = 2;
+ ctx->cursor_row = 0;
+ ctx->cursor_column = 0;
+ ctx->cursor_font = 0;
+ ctx->cursor_color = 0;
+ ctx->active_screen = 0;
+ av_bprint_clear(&ctx->buffer);
+ ctx->buffer_changed = 0;
+}
+
/**
* @param ctx closed caption context just to print log
*/
@@ -570,6 +588,7 @@ AVCodec ff_ccaption_decoder = {
.priv_data_size = sizeof(CCaptionSubContext),
.init = init_decoder,
.close = close_decoder,
+ .flush = flush_decoder,
.decode = decode,
.priv_class = &ccaption_dec_class,
};
--
2.5.3
More information about the ffmpeg-devel
mailing list