Offer has_non_zero_entry_point() from DCPExaminer.
[dcpomatic.git] / src / lib / dcp_examiner.cc
index 72eb828605abe30221077532ab7d7b9dea28aaa5..3515f34c287e749970809cbd3f750d2f8d8da40c 100644 (file)
@@ -145,8 +145,6 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                        if (!reel->main_picture()->asset_ref().resolved()) {
                                LOG_GENERAL("Main picture %1 of reel %2 is missing", reel->main_picture()->id(), reel->id());
                                _needs_assets = true;
-                               /* Use a dummy value here; it will be replaced when the VF is re-examined. */
-                               _video_size = dcp::Size(1998, 1080);
                        } else {
                                LOG_GENERAL("Main picture %1 of reel %2 found", reel->main_picture()->id(), reel->id());
 
@@ -197,17 +195,20 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                        }
                }
 
-               if (reel->main_subtitle()) {
-                       if (!reel->main_subtitle()->asset_ref().resolved()) {
-                               LOG_GENERAL("Main subtitle %1 of reel %2 is missing", reel->main_subtitle()->id(), reel->id());
+               if (auto sub = reel->main_subtitle()) {
+                       if (sub->entry_point().get_value_or(0) != 0) {
+                               _has_non_zero_entry_point[TextType::OPEN_SUBTITLE] = true;
+                       }
+                       if (!sub->asset_ref().resolved()) {
+                               LOG_GENERAL("Main subtitle %1 of reel %2 is missing", sub->id(), reel->id());
                                _needs_assets = true;
                        } else {
-                               LOG_GENERAL("Main subtitle %1 of reel %2 found", reel->main_subtitle()->id(), reel->id());
+                               LOG_GENERAL("Main subtitle %1 of reel %2 found", sub->id(), reel->id());
 
                                _text_count[TextType::OPEN_SUBTITLE] = 1;
-                               _open_subtitle_language = try_to_parse_language(reel->main_subtitle()->language());
+                               _open_subtitle_language = try_to_parse_language(sub->language());
 
-                               auto asset = reel->main_subtitle()->asset();
+                               auto asset = sub->asset();
                                for (auto const& font: asset->font_data()) {
                                        _fonts.push_back({reel_index, asset->id(), make_shared<dcpomatic::Font>(font.first, font.second)});
                                }
@@ -227,6 +228,9 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                }
 
                for (auto ccap: reel->closed_captions()) {
+                       if (ccap->entry_point().get_value_or(0) != 0) {
+                               _has_non_zero_entry_point[TextType::CLOSED_CAPTION] = true;
+                       }
                        if (!ccap->asset_ref().resolved()) {
                                LOG_GENERAL("Closed caption %1 of reel %2 is missing", ccap->id(), reel->id());
                                _needs_assets = true;