From a7185fbb605573b25d74aacb4f3802993bb89a93 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Thu, 7 Sep 2023 09:23:41 -0500 Subject: Revert "sd_lavc: use SUB_GAP_THRESHOLD for overlaps/gaps" Yet another bad idea. It turns out that there's already a sub-fix-timing option which logic for this exact thing (overlaps/gaps) fixing. Also it works better than this since it doesn't appear to artifically increase sub duration either. Fixes #12327. This reverts commit 725b631ec3bdd5016072b5a6aa6a218fb87ffd11. --- sub/sd_lavc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index 7d0a7ffc2e..e3a62da9f1 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -397,8 +397,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 + SUB_GAP_THRESHOLD >= sub->pts) && - (sub->endpts == MP_NOPTS_VALUE || pts - SUB_GAP_THRESHOLD <= sub->endpts))) + ((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) -- cgit v1.2.3