summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-07-11 10:12:25 +0100
committerCarl Hetherington <cth@carlh.net>2017-07-11 10:12:25 +0100
commit490af886b6194208d90957e362557d66b04a9261 (patch)
tree33d2094301de2caa42b053401b0d6db1443e5aeb /src/lib
parent800b8a05df037512624db03a0fd08b93955d6bf5 (diff)
Fix missing subtitle when it is at the same time as some video in different content.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index be6ff2bb4..fb9e208fa 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -511,7 +511,10 @@ Player::pass ()
BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
if (!i->done) {
DCPTime const t = content_time_to_dcp (i, i->decoder->position());
- if (!earliest || t < earliest_content) {
+ /* Given two choices at the same time, pick the one with a subtitle so we see it before
+ the video.
+ */
+ if (!earliest || t < earliest_content || (t == earliest_content && i->decoder->subtitle)) {
earliest_content = t;
earliest = i;
}
@@ -520,7 +523,7 @@ Player::pass ()
bool done = false;
- if (!_black.done() && (!earliest ||_black.position() < earliest_content)) {
+ if (!_black.done() && (!earliest || _black.position() < earliest_content)) {
/* There is some black that must be emitted */
emit_video (black_player_video_frame(), _black.position());
_black.set_position (_black.position() + one_video_frame());