diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-10-02 00:13:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-10-02 00:13:31 +0100 |
| commit | 86cb57f329a4b8e58fdbe3ff610bdf56d6b4657c (patch) | |
| tree | 1c716f1a8d5e55d1d6c15d4b06f41f5f45ae07dd /src/lib | |
| parent | 9c29ced5d331ae3c9a172172031a5311b40ece67 (diff) | |
Apply y offset to text subs.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 5961292ca..94bbf0c3d 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -17,8 +17,6 @@ */ -#include <stdint.h> -#include <algorithm> #include "player.h" #include "film.h" #include "ffmpeg_decoder.h" @@ -48,6 +46,9 @@ #include "dcp_decoder.h" #include "dcp_subtitle_content.h" #include "dcp_subtitle_decoder.h" +#include <boost/foreach.hpp> +#include <stdint.h> +#include <algorithm> #define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); @@ -572,8 +573,11 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting) } list<ContentTextSubtitle> text = subtitle_decoder->get_text_subtitles (ContentTimePeriod (from, to), starting); - for (list<ContentTextSubtitle>::const_iterator i = text.begin(); i != text.end(); ++i) { - copy (i->subs.begin(), i->subs.end(), back_inserter (ps.text)); + BOOST_FOREACH (ContentTextSubtitle& ts, text) { + BOOST_FOREACH (dcp::SubtitleString& s, ts.subs) { + s.set_v_position (s.v_position() + subtitle_content->subtitle_y_offset ()); + ps.text.push_back (s); + } } } |
