Cleanup: whitespace and header sorting.
[dcpomatic.git] / src / lib / video_content.cc
index c10a94f43f372a4ca184ab4edddcf8577367de58..6c3f23a5702ebd2735936c914b204bc8c366bfc4 100644 (file)
@@ -623,6 +623,7 @@ VideoContent::take_settings_from (shared_ptr<const VideoContent> c)
        set_fade_in (c->_fade_in);
        set_fade_out (c->_fade_out);
        set_burnt_subtitle_language (c->_burnt_subtitle_language);
+       set_range(c->_range);
 }
 
 
@@ -650,7 +651,10 @@ VideoContent::scaled_size (dcp::Size film_container)
        }
 
        if (_custom_size) {
-               return *_custom_size;
+               if (_custom_size->width <= film_container.width && _custom_size->height <= film_container.height) {
+                       return *_custom_size;
+               }
+               return fit_ratio_within(_custom_size->ratio(), film_container);
        }
 
        auto size = size_after_crop ();