summaryrefslogtreecommitdiffstats
path: root/sub/dec_sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-20 16:23:44 +0100
committerwm4 <wm4@nowhere>2016-02-20 16:42:32 +0100
commitda24cb9e3e861aa1499506014fecfcb87cd8c535 (patch)
tree0fcb35be8254aff103b54d745a7657ab7ab42d50 /sub/dec_sub.c
parent297fdcc0955f70ff03bbd07a6d23550159a41b62 (diff)
downloadmpv-da24cb9e3e861aa1499506014fecfcb87cd8c535.tar.bz2
mpv-da24cb9e3e861aa1499506014fecfcb87cd8c535.tar.xz
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.
Diffstat (limited to 'sub/dec_sub.c')
-rw-r--r--sub/dec_sub.c6
1 files changed, 5 insertions, 1 deletions
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);
}