summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-04 11:43:55 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-04 11:43:55 +0100
commit9655db97eae5a6137a45ad809dbf42528dc74408 (patch)
tree178ecd2e313ceb6aa7d11fbadb950c53381f1280 /src/lib/ffmpeg_content.cc
parentc88a8a6ec6b396dc90d40a4843160d616a45db76 (diff)
Add 'starting' option to subtitles_during().
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index f97e324bb..a1992102c 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -397,7 +397,7 @@ FFmpegContent::audio_analysis_path () const
}
list<ContentTimePeriod>
-FFmpegContent::subtitles_during (ContentTimePeriod period) const
+FFmpegContent::subtitles_during (ContentTimePeriod period, bool starting) const
{
list<ContentTimePeriod> d;
@@ -408,7 +408,7 @@ FFmpegContent::subtitles_during (ContentTimePeriod period) const
/* XXX: inefficient */
for (vector<ContentTimePeriod>::const_iterator i = stream->periods.begin(); i != stream->periods.end(); ++i) {
- if (period.overlaps (*i)) {
+ if ((starting && period.contains (i->from)) || (!starting && period.overlaps (*i))) {
d.push_back (*i);
}
}