From 24d54ea7fe1ba128cf8d3521d6738fc73a7c623e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 May 2014 16:53:38 +0100 Subject: Basics of noting subtitle times in FFmpegSubtitleStreams. --- src/lib/ffmpeg_content.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/lib/ffmpeg_content.cc') 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 stream = subtitle_stream (); + + /* XXX: inefficient */ + for (vector::const_iterator i = stream->periods.begin(); i != stream->periods.end(); ++i) { + if (i->from <= period.to && i->to >= period.from) { + return true; + } + } + + return false; +} -- cgit v1.2.3