From da24cb9e3e861aa1499506014fecfcb87cd8c535 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Feb 2016 16:23:44 +0100 Subject: sub: always clip subtitles against segment end This happens only if the new segment wasn't read yet. This is not quite proper and a problem with dec_sub.c internals. Ideally, it'd wait with rendering until a new enough segment has been read. Normally, the new segment is available immediately, so the end will be automatically clipped by switching to the right segment in the exact moment it's supposed to become effective. Usually shouldn't cause any problems, though. --- sub/dec_sub.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sub') diff --git a/sub/dec_sub.c b/sub/dec_sub.c index 58562140fa..75f5509c62 100644 --- a/sub/dec_sub.c +++ b/sub/dec_sub.c @@ -243,10 +243,14 @@ void sub_get_bitmaps(struct dec_sub *sub, struct mp_osd_res dim, double pts, { struct MPOpts *opts = sub->opts; + *res = (struct sub_bitmaps) {0}; + sub->last_vo_pts = pts; update_segment(sub); - *res = (struct sub_bitmaps) {0}; + if (sub->end != MP_NOPTS_VALUE && pts >= sub->end) + return; + if (opts->sub_visibility && sub->sd->driver->get_bitmaps) sub->sd->driver->get_bitmaps(sub->sd, dim, pts, res); } -- cgit v1.2.3