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;
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