summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_subtitle_stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffmpeg_subtitle_stream.cc')
-rw-r--r--src/lib/ffmpeg_subtitle_stream.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc
index 27099b0f3..e12075581 100644
--- a/src/lib/ffmpeg_subtitle_stream.cc
+++ b/src/lib/ffmpeg_subtitle_stream.cc
@@ -86,3 +86,14 @@ FFmpegSubtitleStream::find_subtitle_to (ContentTime from) const
DCPOMATIC_ASSERT (i != _subtitles.end ());
return i->second;
}
+
+/** Add some offset to all the times in the stream */
+void
+FFmpegSubtitleStream::add_offset (ContentTime offset)
+{
+ map<ContentTime, ContentTime> fixed;
+ for (map<ContentTime, ContentTime>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
+ fixed[i->first + offset] = i->second + offset;
+ }
+ _subtitles = fixed;
+}