diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-10 16:15:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-10 16:15:13 +0100 |
| commit | 8c6e4c8e4f37450f44cb4ca9918406a6f2cc6055 (patch) | |
| tree | 3b77e87348a5048713520b65e306b25f040494c0 /src/lib | |
| parent | 38164bf6e8095f8a8f852bd21877cfb90d204868 (diff) | |
Various fixes for DCP subtitles, and a test or two.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_subtitle_content.cc | 3 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_decoder.cc | 3 | ||||
| -rw-r--r-- | src/lib/transcoder.cc | 4 | ||||
| -rw-r--r-- | src/lib/writer.cc | 12 |
4 files changed, 17 insertions, 5 deletions
diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index e9998dd2a..83b0d200c 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -24,6 +24,7 @@ #include "i18n.h" using std::string; +using std::list; using boost::shared_ptr; using dcp::raw_convert; @@ -47,7 +48,7 @@ DCPSubtitleContent::examine (shared_ptr<Job> job) { Content::examine (job); dcp::SubtitleContent sc (path (0), false); - _length = DCPTime::from_frames (sc.intrinsic_duration(), sc.edit_rate().as_float ()); + _length = DCPTime::from_seconds (sc.latest_subtitle_out().to_seconds ()); } DCPTime diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index c1f0ab500..20a9f32fe 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -22,6 +22,7 @@ #include "dcp_subtitle_content.h" using std::list; +using std::cout; using boost::shared_ptr; DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content) @@ -55,7 +56,7 @@ DCPSubtitleDecoder::pass () s.push_back (*_next); text_subtitle (s); ++_next; - + return false; } diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc index 843524cce..1012c4544 100644 --- a/src/lib/transcoder.cc +++ b/src/lib/transcoder.cc @@ -68,7 +68,9 @@ Transcoder::go () _encoder->enqueue (*i); } _writer->write (_player->get_audio (t, frame, true)); - _writer->write (_player->get_subtitles (t, frame, true)); + if (!_film->burn_subtitles ()) { + _writer->write (_player->get_subtitles (t, frame, true)); + } } _finishing = true; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index b1dbca0e0..09dd6322e 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -456,7 +456,15 @@ Writer::finish () if (_subtitle_content) { _subtitle_content->write_xml (_film->dir (_film->dcp_name ()) / _film->subtitle_xml_filename ()); - reel->add (shared_ptr<dcp::ReelSubtitleAsset> (new dcp::ReelSubtitleAsset (_subtitle_content, 0))); + reel->add (shared_ptr<dcp::ReelSubtitleAsset> ( + new dcp::ReelSubtitleAsset ( + _subtitle_content, + dcp::Fraction (_film->video_frame_rate(), 1), + _subtitle_content->latest_subtitle_out().to_seconds() * _film->video_frame_rate(), + 0 + ) + )); + dcp.add (_subtitle_content); } @@ -583,7 +591,7 @@ Writer::write (PlayerSubtitles subs) { if (!_subtitle_content) { _subtitle_content.reset ( - new dcp::SubtitleContent (dcp::Fraction (_film->video_frame_rate(), 1), _film->name(), _film->isdcf_metadata().subtitle_language) + new dcp::SubtitleContent (_film->name(), _film->isdcf_metadata().subtitle_language) ); } |
