From: Carl Hetherington Date: Sun, 2 Sep 2018 01:54:44 +0000 (+0100) Subject: Fix subtitle scaling when writing PNG subs. X-Git-Tag: v2.13.47~5 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=64e7d484e2a481ff87fc6d80f092c310c3eae67e;hp=bd12a72f78409e3f482be3d47b5efb57af4ad982;p=dcpomatic.git Fix subtitle scaling when writing PNG subs. --- diff --git a/src/lib/player.cc b/src/lib/player.cc index b939995ef..12c03e306 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -916,7 +916,10 @@ Player::bitmap_text_start (weak_ptr wp, weak_ptr wc, C subtitle.sub.rectangle.height *= text->y_scale (); PlayerText ps; - ps.bitmap.push_back (subtitle.sub); + shared_ptr image = subtitle.sub.image; + /* We will scale the subtitle up to fit _video_container_size */ + dcp::Size scaled_size (subtitle.sub.rectangle.width * _video_container_size.width, subtitle.sub.rectangle.height * _video_container_size.height); + ps.bitmap.push_back (BitmapText(image->scale(scaled_size, dcp::YUV_TO_RGB_REC601, image->pixel_format(), true, _fast), subtitle.sub.rectangle)); DCPTime from (content_time_to_dcp (piece, subtitle.from())); _active_texts[text->type()].add_from (wc, ps, from);