diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-02 02:54:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-02 02:54:44 +0100 |
| commit | 64e7d484e2a481ff87fc6d80f092c310c3eae67e (patch) | |
| tree | 5e86ef584f1549b7c7aaca1610ebd8c43f074f0e /src/lib | |
| parent | bd12a72f78409e3f482be3d47b5efb57af4ad982 (diff) | |
Fix subtitle scaling when writing PNG subs.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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<Piece> wp, weak_ptr<const TextContent> wc, C subtitle.sub.rectangle.height *= text->y_scale (); PlayerText ps; - ps.bitmap.push_back (subtitle.sub); + shared_ptr<Image> 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); |
