From 72e417850394a08fab467f55d4e6ae4a9fbcd23a Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Fri, 18 Aug 2023 19:22:11 -0500 Subject: [PATCH] Revert "sub/sd_lavc: don't check endpts when getting subs" This reverts commit 02a80f850b5403da89fefed7b32b3f3dfb82f647. Bad idea. This causes subs to stay on the screen too long in some cases. Let's try something else to fix the problem. --- sub/sd_lavc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index f4b85e0784..adca4199b1 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -398,7 +398,8 @@ static struct sub *get_current(struct sd_lavc_priv *priv, double pts) if (!sub->valid) continue; if (pts == MP_NOPTS_VALUE || - (sub->pts == MP_NOPTS_VALUE || pts + 1e-6 >= sub->pts)) + ((sub->pts == MP_NOPTS_VALUE || pts + 1e-6 >= sub->pts) && + (sub->endpts == MP_NOPTS_VALUE || pts < sub->endpts))) { // Ignore "trailing" subtitles with unknown length after 1 minute. if (sub->endpts == MP_NOPTS_VALUE && pts >= sub->pts + 60)