diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-15 08:40:14 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-15 22:34:57 +0000 |
| commit | 54d17e98a597334bf1ba2615e3eb6191088f606f (patch) | |
| tree | 83a4f0c1acb2aab41a9cf279bc949474a214951a /src/lib/ffmpeg_content.cc | |
| parent | 57c49675889c0e0ad8cebece7a60bba08ba782d2 (diff) | |
Support SSA subtitles embedded within FFmpeg files.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index b47116bdc..5cd5d3729 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -322,26 +322,49 @@ FFmpegContent::identifier () const } list<ContentTimePeriod> -FFmpegContent::subtitles_during (ContentTimePeriod period, bool starting) const +FFmpegContent::image_subtitles_during (ContentTimePeriod period, bool starting) const { shared_ptr<FFmpegSubtitleStream> stream = subtitle_stream (); if (!stream) { return list<ContentTimePeriod> (); } - return stream->subtitles_during (period, starting); + return stream->image_subtitles_during (period, starting); +} + +list<ContentTimePeriod> +FFmpegContent::text_subtitles_during (ContentTimePeriod period, bool starting) const +{ + shared_ptr<FFmpegSubtitleStream> stream = subtitle_stream (); + if (!stream) { + return list<ContentTimePeriod> (); + } + + return stream->text_subtitles_during (period, starting); } bool -FFmpegContent::has_text_subtitles () const +FFmpegContent::has_image_subtitles () const { + BOOST_FOREACH (shared_ptr<FFmpegSubtitleStream> i, subtitle_streams()) { + if (i->has_image_subtitles()) { + return true; + } + } + return false; } bool -FFmpegContent::has_image_subtitles () const +FFmpegContent::has_text_subtitles () const { - return !subtitle_streams().empty (); + BOOST_FOREACH (shared_ptr<FFmpegSubtitleStream> i, subtitle_streams()) { + if (i->has_text_subtitles()) { + return true; + } + } + + return false; } void |
