diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-09 14:46:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-09 14:46:50 +0100 |
| commit | 9f047a1db33a1beeab4099d91fc52da4b0cdd92d (patch) | |
| tree | eb30b58c9df6d73f0bf8b0556ff2b2bde599afb6 /src | |
| parent | 644bb89cb752eb89d639e16ee0bff70d25a75750 (diff) | |
Subtitle naming fixes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/util.cc | 6 | ||||
| -rw-r--r-- | src/lib/util.h | 1 | ||||
| -rw-r--r-- | src/lib/writer.cc | 12 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index b662f8679..656cf9f4d 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -686,9 +686,3 @@ audio_asset_filename (shared_ptr<dcp::SoundAsset> asset) { return "pcm_" + asset->id() + ".mxf"; } - -string -subtitle_content_filename (shared_ptr<dcp::SubtitleAsset> asset) -{ - return "sub_" + asset->id() + ".xml"; -} diff --git a/src/lib/util.h b/src/lib/util.h index 957453fb7..f908d4fed 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -104,7 +104,6 @@ extern void write_frame_info (FILE* file, int frame, Eyes eyes, dcp::FrameInfo i extern std::map<std::string, std::string> split_get_request (std::string url); extern std::string video_asset_filename (boost::shared_ptr<dcp::PictureAsset> asset); extern std::string audio_asset_filename (boost::shared_ptr<dcp::SoundAsset> asset); -extern std::string subtitle_content_filename (boost::shared_ptr<dcp::SubtitleAsset> content); #endif diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 9e2cf4bd4..7e47c317e 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -524,9 +524,15 @@ Writer::finish () _subtitle_asset->add_font (i->id, i->file.get_value_or (liberation)); } - _subtitle_asset->write ( - _film->dir (_film->dcp_name ()) / _subtitle_asset->id () / subtitle_content_filename (_subtitle_asset) - ); + if (dynamic_pointer_cast<dcp::InteropSubtitleAsset> (_subtitle_asset)) { + boost::filesystem::path directory = _film->dir (_film->dcp_name ()) / _subtitle_asset->id (); + boost::filesystem::create_directories (directory); + _subtitle_asset->write (directory / ("sub_" + _subtitle_asset->id() + ".xml")); + } else { + _subtitle_asset->write ( + _film->dir (_film->dcp_name ()) / ("sub_" + _subtitle_asset->id() + ".mxf") + ); + } reel->add (shared_ptr<dcp::ReelSubtitleAsset> ( new dcp::ReelSubtitleAsset ( |
