Permalink
Browse files

Subtitles: Be less aggressive about auto-selecting a forced track.

1. Don't favor a forced subtitle track if DefaultCCMode=1 (i.e., the
user already wants subtitles or captions which are likely to also
contain the force subtitles).

2. Don't favor a forced subtitle track if AllowForcedSubtitles=0
(i.e., the user doesn't want to be inflicted with forced subtitles).

3. Only favor a forced track if it is a subtitle track.  (Do any other
track types ever have the forced flag set?)

Note that this still may not be perfect, e.g. a user may end up
auto-displaying cc608 captions where a forced subtitle track is still
needed for the complete experience.
  • Loading branch information...
stichnot committed Jun 15, 2012
1 parent ea554c9 commit 689a7b5d526099c2ec533701625ae62ddbba6d44
Showing with 6 additions and 1 deletion.
  1. +3 −1 mythtv/libs/libmythtv/decoderbase.cpp
  2. +3 −0 mythtv/libs/libmythtv/mythplayer.h
@@ -991,7 +991,9 @@ int DecoderBase::AutoSelectTrack(uint type)
selTrack = 0;
for (uint i = 0; i < numStreams; i++)
{
- int forced = (tracks[type][i].forced ? 1 : 0);
+ int forced = (type == kTrackTypeSubtitle &&
+ tracks[type][i].forced &&
+ m_parent->ForcedSubtitlesFavored());
int position = numStreams - i;
int language = 0;
for (int j = 0; language == 0 && j < languagePreference.size(); ++j)
@@ -277,6 +277,9 @@ class MTV_PUBLIC MythPlayer
void TracksChanged(uint trackType);
void EnableSubtitles(bool enable);
void EnableForcedSubtitles(bool enable);
+ bool ForcedSubtitlesFavored(void) const {
+ return allowForcedSubtitles && !captionsEnabledbyDefault;
+ }
// How to handle forced Subtitles (i.e. when in a movie someone speaks
// in a different language than the rest of the movie, subtitles are
// forced on even if the user doesn't have them turned on.)

0 comments on commit 689a7b5

Please sign in to comment.