Don't scale chroma subsampled images to sizes that don't align with the subsampling...
[dcpomatic.git] / src / lib / player.cc
index 7c1a57aa9e4138d492d1f57e6210fc71c724ef99..b93bf3f4a7c2756643e47b4cc8e8f0d2a9bcc6b1 100644 (file)
@@ -70,7 +70,6 @@ using std::dynamic_pointer_cast;
 using std::list;
 using std::make_pair;
 using std::make_shared;
-using std::map;
 using std::max;
 using std::min;
 using std::min;
@@ -921,16 +920,23 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
                }
        }
 
+       auto const content_video = piece->content->video;
+
        _last_video[wp] = std::make_shared<PlayerVideo>(
                video.image,
-               piece->content->video->crop (),
-               piece->content->video->fade (_film, video.frame),
-               scale_for_display(piece->content->video->scaled_size(_film->frame_size()), _video_container_size, _film->frame_size()),
+               content_video->actual_crop(),
+               content_video->fade (_film, video.frame),
+               scale_for_display(
+                       content_video->scaled_size(_film->frame_size()),
+                       _video_container_size,
+                       _film->frame_size(),
+                       content_video->pixel_quanta()
+                       ),
                _video_container_size,
                video.eyes,
                video.part,
-               piece->content->video->colour_conversion(),
-               piece->content->video->range(),
+               content_video->colour_conversion(),
+               content_video->range(),
                piece->content,
                video.frame,
                false