summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/video_content.cc2
-rw-r--r--src/wx/film_viewer.cc10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index de3d3f3a2..1d1d010a9 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -660,7 +660,7 @@ VideoContent::scaled_size (dcp::Size film_container)
}
auto size = size_after_crop ();
- size.width *= _sample_aspect_ratio.get_value_or(1);
+ size.width = std::lrint(size.width * _sample_aspect_ratio.get_value_or(1));
/* This is what we will return unless there is any legacy stuff to take into account */
auto auto_size = fit_ratio_within (size.ratio(), film_container);
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index b5b2ca972..c56e2f5d2 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -303,6 +303,16 @@ FilmViewer::calculate_sizes ()
out_size.width = max (64, out_size.width);
out_size.height = max (64, out_size.height);
+ /* Make sure the video container sizes are always a multiple of 2 so that
+ * we don't get gaps with subsampled sources (e.g. YUV420)
+ */
+ if (out_size.width % 2) {
+ out_size.width++;
+ }
+ if (out_size.height % 2) {
+ out_size.height++;
+ }
+
_player->set_video_container_size (out_size);
}