summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-22 16:53:38 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-22 16:53:38 +0100
commit24d54ea7fe1ba128cf8d3521d6738fc73a7c623e (patch)
tree7c3674e34b30f81334dc8f35a91d3cbb31b7ff9d /src/lib/ffmpeg_content.cc
parentd156fe45ee21fc416ce6b9e43ceed95bf42fde41 (diff)
Basics of noting subtitle times in FFmpegSubtitleStreams.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index a191959fc..2b507ab37 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -392,3 +392,18 @@ FFmpegContent::audio_analysis_path () const
p /= name;
return p;
}
+
+bool
+FFmpegContent::has_subtitle_during (ContentTimePeriod period) const
+{
+ shared_ptr<FFmpegSubtitleStream> stream = subtitle_stream ();
+
+ /* XXX: inefficient */
+ for (vector<ContentTimePeriod>::const_iterator i = stream->periods.begin(); i != stream->periods.end(); ++i) {
+ if (i->from <= period.to && i->to >= period.from) {
+ return true;
+ }
+ }
+
+ return false;
+}