Skip to content

Commit

Permalink
Fix failure to clear last forced subtitle in a sequence
Browse files Browse the repository at this point in the history
Some types of subtitle, rather than being tagged with a duration, rely
on the next in sequence to clear them, specifically with an empty
subtitle at the end of the sequence. AddAVSubtitle has to handle forced
subtitles, causing them to be displayed even when subtitles are off. It
was detecting a subtitle being forced by looking for a "forced" flag
amongst the subtitle's rectangles. That failed to detect the case of an
empty subtitle. Hence the last non-empty forced subtitle was not being
cleared by the subsequent empty one. This commit changes the detection
condition, using instead a flag that denotes whether the subtitle is from
the currently selected forced track.
  • Loading branch information
Paul Gardiner committed Nov 29, 2024
1 parent 6696609 commit 6dfe207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/captions/subtitlereader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool SubtitleReader::AddAVSubtitle(AVSubtitle &subtitle,

if (!m_avSubtitlesEnabled && !isExternal)
{
if (!forced)
if (!(is_selected_forced_track || forced))
{
FreeAVSubtitle(subtitle);
return enableforced;
Expand Down

0 comments on commit 6dfe207

Please sign in to comment.