summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-16 00:28:27 +0100
committerCarl Hetherington <cth@carlh.net>2023-03-16 00:44:42 +0100
commit270afed38c075cb8c2c56534674912d195a9d1f9 (patch)
tree2d8050d56a1558f476cd494c4578dc97f31d351c /src/lib
parentf1e36736030b55f2971ea27d2fdecb89aba20455 (diff)
Don't use pointless scale_for_display() (#2485).
Not only is it much more complicated than it needs to be, but it also meant that for a PlayerVideo _inter_size and _out_size are calculated slightly differently, meaning that when trying to put a full-frame image into the output there could sometimes be small differences between the two, meaning small gaps.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc7
-rw-r--r--src/lib/player_video.cc7
-rw-r--r--src/lib/util.cc19
-rw-r--r--src/lib/util.h1
4 files changed, 2 insertions, 32 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 610d7748d..aad423094 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -1093,12 +1093,7 @@ Player::video (weak_ptr<Piece> weak_piece, ContentVideo video)
video.image,
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()
- ),
+ content_video->scaled_size(_video_container_size),
_video_container_size,
eyes,
video.part,
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc
index d45bf9f43..37fc817d1 100644
--- a/src/lib/player_video.cc
+++ b/src/lib/player_video.cc
@@ -362,12 +362,7 @@ PlayerVideo::reset_metadata (shared_ptr<const Film> film, dcp::Size player_video
_crop = content->video->actual_crop();
_fade = content->video->fade(film, _video_frame.get());
- _inter_size = scale_for_display(
- content->video->scaled_size(film->frame_size()),
- player_video_container_size,
- film->frame_size(),
- content->video->pixel_quanta()
- );
+ _inter_size = content->video->scaled_size(player_video_container_size);
_out_size = player_video_container_size;
_colour_conversion = content->video->colour_conversion();
_video_range = content->video->range();
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 20a965781..9e077c7e0 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -980,25 +980,6 @@ copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::fun
}
-dcp::Size
-scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta)
-{
- /* Now scale it down if the display container is smaller than the film container */
- if (display_container != film_container) {
- float const scale = min (
- float (display_container.width) / film_container.width,
- float (display_container.height) / film_container.height
- );
-
- s.width = lrintf (s.width * scale);
- s.height = lrintf (s.height * scale);
- s = quanta.round (s);
- }
-
- return s;
-}
-
-
dcp::DecryptedKDM
decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm)
{
diff --git a/src/lib/util.h b/src/lib/util.h
index 4c8a2b1b7..26698af02 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -89,7 +89,6 @@ extern std::shared_ptr<AudioBuffers> remap (std::shared_ptr<const AudioBuffers>
extern size_t utf8_strlen (std::string s);
extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, std::shared_ptr<TextDecoder> decoder);
extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)>);
-extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta);
extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm);
extern boost::filesystem::path default_font_file ();
extern void start_of_thread (std::string name);