Skip to content

Commit 74dba35

Browse files
committed
Subtitles: Fix state calculation in EnableCaptions/DisableCaptions.
26f6437 was too aggressive in assuming that EnableCaptions would actually enable text subtitles, and DisableCaptions would actually disable text subtitles. They only enable/disable a particular type of subtitles (which may have already been enabled/disabled), so we need to check the overall state after the operation is performed. (cherry picked from commit 0925cc0)
1 parent bcdaa88 commit 74dba35

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

mythtv/libs/libmythtv/mythplayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ void MythPlayer::DisableCaptions(uint mode, bool osd_msg)
13771377

13781378
QMutexLocker locker(&osdLock);
13791379

1380-
textDesired = false;
1380+
textDesired = textDisplayMode & kDisplayAllTextCaptions;
13811381
QString msg = "";
13821382
if (kDisplayNUVTeletextCaptions & mode)
13831383
msg += tr("TXT CAP");
@@ -1414,7 +1414,7 @@ void MythPlayer::DisableCaptions(uint mode, bool osd_msg)
14141414
void MythPlayer::EnableCaptions(uint mode, bool osd_msg)
14151415
{
14161416
QMutexLocker locker(&osdLock);
1417-
textDesired = true;
1417+
textDesired = mode & kDisplayAllTextCaptions;
14181418
QString msg = "";
14191419
if ((kDisplayCC608 & mode) || (kDisplayCC708 & mode) ||
14201420
(kDisplayAVSubtitle & mode) || kDisplayRawTextSubtitle & mode)

mythtv/libs/libmythtv/mythplayer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ enum
7777
kDisplayRawTextSubtitle = 0x080,
7878
kDisplayAllCaptions = 0x0FF,
7979
kDisplayTeletextMenu = 0x100,
80+
kDisplayAllTextCaptions = ~kDisplayDVDButton &
81+
~kDisplayAVSubtitle &
82+
kDisplayAllCaptions,
8083
};
8184

8285
enum PlayerFlags

0 commit comments

Comments
 (0)