Add DCPContent::resolution().
authorCarl Hetherington <cth@carlh.net>
Tue, 21 Apr 2020 21:07:07 +0000 (23:07 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 21 Apr 2020 21:33:44 +0000 (23:33 +0200)
src/lib/dcp_content.cc
src/lib/dcp_content.h

index 94d5c010bd0b7202c79b48fb1dc4e809373c06fc..6c2db91d3bbcbb093f89a8fabba5bc4a65023d56 100644 (file)
@@ -606,13 +606,8 @@ DCPContent::can_reference_video (shared_ptr<const Film> film, string& why_not) c
                return false;
        }
 
-       Resolution video_res = RESOLUTION_2K;
-       if (video->size().width > 2048 || video->size().height > 1080) {
-               video_res = RESOLUTION_4K;
-       }
-
-       if (film->resolution() != video_res) {
-               if (video_res == RESOLUTION_4K) {
+       if (film->resolution() != resolution()) {
+               if (resolution() == RESOLUTION_4K) {
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("it is 4K and the film is 2K.");
                } else {
@@ -738,3 +733,15 @@ DCPContent::kdm_timing_window_valid () const
        dcp::LocalTime now;
        return _kdm->not_valid_before() < now && now < _kdm->not_valid_after();
 }
+
+
+Resolution
+DCPContent::resolution () const
+{
+       if (video->size().width > 2048 || video->size().height > 1080) {
+               return RESOLUTION_4K;
+       }
+
+       return RESOLUTION_2K;
+}
+
index b9c4d9ee511a0a0ea90c6119bb67ec09c28b52bb..8658ac5ed83e3358094709f1166215aabe9004f9 100644 (file)
@@ -156,6 +156,8 @@ public:
 
        bool kdm_timing_window_valid () const;
 
+       Resolution resolution () const;
+
 private:
        friend class reels_test5;