X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fplayer.cc;h=bc0aa3b28c248e71f086d14761429d1407e3205f;hp=62527e3ebbf3b60408bd2cc967ffb568f529ddf8;hb=dec5ae11238495c64fffdab37f189d96aed7d636;hpb=c2cc3e03b3b5973b64271cd8dcf4e7843e8b6d1e diff --git a/src/lib/player.cc b/src/lib/player.cc index 62527e3eb..bc0aa3b28 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2019 Carl Hetherington + Copyright (C) 2013-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -955,8 +955,15 @@ Player::bitmap_text_start (weak_ptr wp, weak_ptr wc, C PlayerText ps; 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); + int const width = subtitle.sub.rectangle.width * _video_container_size.width; + int const height = subtitle.sub.rectangle.height * _video_container_size.height; + if (width == 0 || height == 0) { + return; + } + + dcp::Size scaled_size (width, 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()));