summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-27 20:28:26 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-27 20:28:26 +0000
commit84cab4dbc3beba84ba53cec1054ede7c250a4c9c (patch)
tree9f78d4b375e4aaa941610311a3a856e8d12b4481 /src/lib
parentaec8cf0f4f2a3e0913804a60695662973c21d5c3 (diff)
Fix reel that subtitles are put in when they are exactly on a reel boundary.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/writer.cc8
-rw-r--r--src/lib/writer.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index ab5d3504c..17bd21daf 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -150,6 +150,12 @@ Writer::write (Data encoded, Frame frame, Eyes eyes)
_empty_condition.notify_all ();
}
+bool
+Writer::can_repeat (Frame frame) const
+{
+ return frame > _reels[video_reel(frame)].start();
+}
+
/** Repeat the last frame that was written to a reel as a new frame.
* @param frame Frame index within the DCP of the new (repeated) frame.
* @param eyes Eyes that this repeated frame image is for.
@@ -519,7 +525,7 @@ Writer::write (PlayerSubtitles subs)
return;
}
- if (_subtitle_reel->period().to < subs.from) {
+ if (_subtitle_reel->period().to <= subs.from) {
++_subtitle_reel;
}
diff --git a/src/lib/writer.h b/src/lib/writer.h
index 28e243c35..5c974f0f3 100644
--- a/src/lib/writer.h
+++ b/src/lib/writer.h
@@ -95,6 +95,7 @@ public:
void write (Data, Frame, Eyes);
void fake_write (Frame, Eyes);
+ bool can_repeat (Frame) const;
void repeat (Frame, Eyes);
void write (boost::shared_ptr<const AudioBuffers>);
void write (PlayerSubtitles subs);