1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 20:27:23 +00:00

sd_lavc: ignore image subtitles with unknown duration after 1 minute

Most image subtitle formats implicitly terminate the current subtitle
event with the next event (e.g. a new packet read from the demuxer will
instruct the subtitle render to stop display). If the subtitle event is
just trailing, it will be displayed forever. So there's no proper way
of doing this and we just apply an heuristic to avoid annoyances.
This commit is contained in:
wm4 2014-12-22 00:00:18 +01:00
parent 1e3400e353
commit bdae2f8fa8

View File

@ -277,6 +277,9 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, double pts,
((sub->pts == MP_NOPTS_VALUE || pts >= 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)
break;
current = sub;
break;
}