diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-04-25 23:43:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-04-25 23:43:16 +0100 |
| commit | 9c1e0071803bf05f8c476d870e360c9e320ba696 (patch) | |
| tree | c94a825ad7a32495fa7e372ce79247e69c84c272 /src/lib/subtitle.cc | |
| parent | 588397fc600e888acf77375fe39c238ff2bf3649 (diff) | |
Fix subtitle display when the next subtitle is decoded before the
previous one has finished; this requires that more than one subtitle be
kept by the player.
Reported-by: Matthias Damm
Diffstat (limited to 'src/lib/subtitle.cc')
| -rw-r--r-- | src/lib/subtitle.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc index f348833b0..0d18861c4 100644 --- a/src/lib/subtitle.cc +++ b/src/lib/subtitle.cc @@ -97,6 +97,8 @@ Subtitle::update (shared_ptr<const Film> film, libdcp::Size video_container_size _out_from = from + piece->content->position (); _out_to = to + piece->content->position (); + + check_out_to (); } bool @@ -104,3 +106,11 @@ Subtitle::covers (Time t) const { return _out_from <= t && t <= _out_to; } + +void +Subtitle::check_out_to () +{ + if (_stop && _out_to > _stop.get ()) { + _out_to = _stop.get (); + } +} |
