From 6dfe207639a2d6b24f5d627455b9b3cc42f1da2b Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Sun, 24 Nov 2024 12:47:35 +0000 Subject: [PATCH] Fix failure to clear last forced subtitle in a sequence 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. --- mythtv/libs/libmythtv/captions/subtitlereader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythtv/libs/libmythtv/captions/subtitlereader.cpp b/mythtv/libs/libmythtv/captions/subtitlereader.cpp index 03fb45aac6c..6566c31ecbe 100644 --- a/mythtv/libs/libmythtv/captions/subtitlereader.cpp +++ b/mythtv/libs/libmythtv/captions/subtitlereader.cpp @@ -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;