1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

avcodec/ccaption_dec: switch active screen in end of caption early

Fixes dropping of last caption.
This commit is contained in:
Paul B Mahol 2020-06-13 11:57:33 +02:00
parent 847d0b99de
commit 0c2623d3aa

View File

@ -603,12 +603,13 @@ static int handle_eoc(CCaptionSubContext *ctx, int64_t pts)
{ {
int ret; int ret;
ctx->active_screen = !ctx->active_screen;
// In buffered mode, we wait til the *next* EOC and // In buffered mode, we wait til the *next* EOC and
// reap what was already on the screen since the last EOC. // reap what was already on the screen since the last EOC.
if (!ctx->real_time) if (!ctx->real_time)
ret = handle_edm(ctx,pts); ret = handle_edm(ctx,pts);
ctx->active_screen = !ctx->active_screen;
ctx->cursor_column = 0; ctx->cursor_column = 0;
// In realtime mode, we display the buffered contents (after // In realtime mode, we display the buffered contents (after