Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2016-01-06 08:46:27 +0300
committerClément Bœsch <u@pkh.me>2016-01-15 00:08:59 +0300
commit260e3687173b24f20566da1cec4a3b4541d77fca (patch)
tree2427c25a974a6ea4d6f9f28cf9633dbaff13dd66 /libavcodec/ccaption_dec.c
parenteb7802afefb7af4da50bc56818cdab9da07de7d0 (diff)
lavc/ccaption_dec: flush context on seek
Diffstat (limited to 'libavcodec/ccaption_dec.c')
-rw-r--r--libavcodec/ccaption_dec.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index ca497e5de2..6cb826c363 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -173,6 +173,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;
+ ctx->buffer_changed = 0;
+ av_bprint_clear(&ctx->buffer);
+}
+
/**
* @param ctx closed caption context just to print log
*/
@@ -578,6 +596,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,
};