From e76da9d56c036d65f0554c51024526ff43475437 Mon Sep 17 00:00:00 2001 From: alaotach Date: Wed, 8 Jul 2026 20:02:13 +0530 Subject: [PATCH] Fix 40ms gap in rolling teletext subtitles --- src/lib_ccx/telxcc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib_ccx/telxcc.c b/src/lib_ccx/telxcc.c index 6e7251364..a45bbfda2 100644 --- a/src/lib_ccx/telxcc.c +++ b/src/lib_ccx/telxcc.c @@ -1054,8 +1054,11 @@ void process_telx_packet(struct TeletextCtx *ctx, data_unit_t data_unit_id, tele ctx->page_buffer.text[yt][it] = telx_to_ucs2(ctx->page_buffer.text[yt][it]); } } - // it would be nice, if subtitle hides on previous video frame, so we contract 40 ms (1 frame @25 fps) - ctx->page_buffer.hide_timestamp = timestamp - 40; + // Previously subtracted 40ms (1 frame @ 25fps) to hide subtitle "early". + // This is wrong for non-25fps content and causes a visible ~41ms blink gap + // in rolling teletext subs, because the WebVTT exporter already subtracts + // 1ms to prevent timestamp boundary collisions. That 1ms is sufficient. + ctx->page_buffer.hide_timestamp = timestamp; if (ctx->page_buffer.hide_timestamp > timestamp) { ctx->page_buffer.hide_timestamp = 0;