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.
This commit is contained in:
wm4 2016-02-20 16:23:44 +01:00
parent 297fdcc095
commit da24cb9e3e
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}