diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-03 22:13:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-03 22:13:13 +0100 |
| commit | 52dc2f13d5cd03403da20e1764ba474c829a1a26 (patch) | |
| tree | 28ff84ffc648c499ef3c647c0c85ae15a84d9739 /src/lib/player.cc | |
| parent | 0226862cd32e8b2a10d0cdc0c9c5e7682d364075 (diff) | |
| parent | c9e807a398ffa4c6ba38a26e2721250bdbef10d7 (diff) | |
Merge branch 'main' into v2.17.x
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 9debbaf7b..888c56aec 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -912,7 +912,7 @@ Player::open_subtitles_for_frame (DCPTime time) const /* Bitmap subtitles */ for (auto i: j.bitmap) { - if (!i.image) { + if (!i.image || i.image->size().width == 0 || i.image->size().height == 0) { continue; } @@ -933,7 +933,10 @@ Player::open_subtitles_for_frame (DCPTime time) const /* String subtitles (rendered to an image) */ if (!j.string.empty()) { auto s = render_text(j.string, _video_container_size, time, vfr); - copy (s.begin(), s.end(), back_inserter (captions)); + copy_if(s.begin(), s.end(), back_inserter(captions), [](PositionImage const& image) { + return image.image->size().width && image.image->size().height; + }); + } } |
