summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-05-31 20:13:50 +0200
committerCarl Hetherington <cth@carlh.net>2023-06-04 20:50:06 +0200
commitcc39c4f57fc48c581a25dc4c37f26adf95278914 (patch)
tree897a4eebbbc59f08ebc760459693d4b35bd26f35 /src/lib
parent00734ea5fe3f6946de02e6d9ec3e786c67bae4da (diff)
Fix missing subtitle language in CPL on auto-created empty subtitle assets (#2548).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/reel_writer.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index 658de0a62..aae2a6273 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -655,12 +655,7 @@ ReelWriter::create_reel_text (
_subtitle_asset, duration, reel, _reel_index, _reel_count, _content_summary, refs, film(), _period, output_dcp, _text_only
);
- if (subtitle) {
- /* We have a subtitle asset that we either made or are referencing */
- if (auto main_language = film()->subtitle_languages().first) {
- subtitle->set_language (*main_language);
- }
- } else if (ensure_subtitles) {
+ if (!subtitle && ensure_subtitles) {
/* We had no subtitle asset, but we've been asked to make sure there is one */
subtitle = maybe_add_text<dcp::ReelInteropSubtitleAsset, dcp::ReelSMPTESubtitleAsset, dcp::ReelSubtitleAsset> (
empty_text_asset(TextType::OPEN_SUBTITLE, optional<DCPTextTrack>(), true),
@@ -677,6 +672,13 @@ ReelWriter::create_reel_text (
);
}
+ if (subtitle) {
+ /* We have a subtitle asset that we either made or are referencing */
+ if (auto main_language = film()->subtitle_languages().first) {
+ subtitle->set_language (*main_language);
+ }
+ }
+
for (auto const& i: _closed_caption_assets) {
auto a = maybe_add_text<dcp::ReelInteropClosedCaptionAsset, dcp::ReelSMPTEClosedCaptionAsset, dcp::ReelClosedCaptionAsset> (
i.second, duration, reel, _reel_index, _reel_count, _content_summary, refs, film(), _period, output_dcp, _text_only