projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd12a72
)
Fix subtitle scaling when writing PNG subs.
author
Carl Hetherington
<cth@carlh.net>
Sun, 2 Sep 2018 01:54:44 +0000
(
02:54
+0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 2 Sep 2018 01:54:44 +0000
(
02:54
+0100)
src/lib/player.cc
patch
|
blob
|
history
diff --git
a/src/lib/player.cc
b/src/lib/player.cc
index b939995ef7bbaa7c5fdc6953be645da0fe803295..12c03e3066ad4c47ed311ee454f2c482c0eabe5e 100644
(file)
--- 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;
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);
DCPTime from (content_time_to_dcp (piece, subtitle.from()));
_active_texts[text->type()].add_from (wc, ps, from);