From 0c2623d3aad066fa5deffae4716af463b14091ab Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 13 Jun 2020 11:57:33 +0200 Subject: [PATCH] avcodec/ccaption_dec: switch active screen in end of caption early Fixes dropping of last caption. --- libavcodec/ccaption_dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index 7a494b25a4..936e2db27f 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -603,12 +603,13 @@ static int handle_eoc(CCaptionSubContext *ctx, int64_t pts) { int ret; + ctx->active_screen = !ctx->active_screen; + // In buffered mode, we wait til the *next* EOC and // reap what was already on the screen since the last EOC. if (!ctx->real_time) ret = handle_edm(ctx,pts); - ctx->active_screen = !ctx->active_screen; ctx->cursor_column = 0; // In realtime mode, we display the buffered contents (after