diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-15 01:03:51 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-16 22:38:05 +0200 |
| commit | 7e39519864cf40256a31fb6d42818c1a02fa2d63 (patch) | |
| tree | 94c432345fd98fc3df803f664f993915bd8c1a52 /src/lib | |
| parent | c103d8c1306e5fb3937b3a6c430a3fff32653fa3 (diff) | |
Fix black borders around the preview in some cases (#2331).
We need to round the container size to the nearest multiple of 2
so that cropping subsampled sources does not leave gaps. As far
as I can see:
- the direction that you round x in doesn't matter
- it's better to round y up
(if you calculate the error in the resulting ratio in each case).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/video_content.cc | 2 |
1 files changed, 1 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); |
