diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-03-07 23:48:08 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-03-07 23:48:08 +0100 |
| commit | 7187b4ef5966b4b4e993cebedb68e158d076c536 (patch) | |
| tree | 8e87b9a5dccd3402a2e61181bea48569b77c255b /src/lib/hints.cc | |
| parent | 7fce30aad85f04276a7695b1daf8ffb9fdd267b5 (diff) | |
WIP: ruby2652-ruby
Diffstat (limited to 'src/lib/hints.cc')
| -rw-r--r-- | src/lib/hints.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 99882ec0e..f3e91dbea 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -586,17 +586,19 @@ Hints::closed_caption(PlayerText text, DCPTimePeriod period) { int lines = text.string.size(); for (auto i: text.string) { - if (utf8_strlen(i.text()) > MAX_CLOSED_CAPTION_LENGTH) { - ++lines; - if (!_long_ccap) { - _long_ccap = true; - hint( - fmt::format( - "At least one of your closed caption lines has more than {} characters. " - "It is advisable to make each line {} characters at most in length.", - MAX_CLOSED_CAPTION_LENGTH, - MAX_CLOSED_CAPTION_LENGTH) - ); + if (auto text_string = i.string_text()) { + if (utf8_strlen(*text_string) > MAX_CLOSED_CAPTION_LENGTH) { + ++lines; + if (!_long_ccap) { + _long_ccap = true; + hint( + fmt::format( + "At least one of your closed caption lines has more than {} characters. " + "It is advisable to make each line {} characters at most in length.", + MAX_CLOSED_CAPTION_LENGTH, + MAX_CLOSED_CAPTION_LENGTH) + ); + } } } } |
