Permalink
Browse files

[subtitles] drop 'prefer external' option, always preferring

  • Loading branch information...
1 parent 08876d0 commit ba2c7604ab35a0be5b5b8309721dbb27aea871ed Jonathan Marshall committed with Jonathan Marshall Feb 23, 2014
Showing with 23 additions and 71 deletions.
  1. +1 −12 language/English/strings.po
  2. +0 −5 system/settings/settings.xml
  3. +11 −27 xbmc/cores/dvdplayer/DVDPlayer.cpp
  4. +11 −27 xbmc/cores/omxplayer/OMXPlayer.cpp
@@ -11147,18 +11147,7 @@ msgctxt "#21469"
msgid "%s to %s"
msgstr ""
-#empty strings from id 21470 to 21599
-
-#: xbmc/cores/dvdplayer/DVDPlayer.cpp
-msgctxt "#21600"
-msgid "Prefer external subtitles"
-msgstr ""
-
-#. Description of setting "Video -> Subtitles -> Prefer external subtitles" with label #21600
-#: system/settings/settings.xml
-msgctxt "#21601"
-msgid "Prefer external subtitles to internal ones."
-msgstr ""
+#empty strings from id 21470 to 21601
#: xbmc/Util.cpp
msgctxt "#21602"
@@ -800,11 +800,6 @@
</category>
<category id="subtitles" label="287" help="36184">
<group id="1">
- <setting id="subtitles.preferexternal" type="boolean" label="21600" help="21601">
- <level>1</level>
- <default>true</default>
- <control type="toggle" />
- </setting>
<setting id="subtitles.languages" type="list[string]" label="24111" help="24112">
<level>1</level>
<default>English</default>
@@ -141,36 +141,31 @@ class PredicateSubtitleFilter
private:
std::string audiolang;
bool original;
- bool preferexternal;
public:
/** \brief The class' operator() decides if the given (subtitle) SelectionStream is relevant wrt.
* preferred subtitle language and audio language. If the subtitle is relevant <B>false</B> false is returned.
*
* A subtitle is relevant if
* - it was previously selected, or
- * - it's an external sub and "prefer external subs was selected", or
+ * - it's an external sub, or
* - it's a forced sub and "original stream's language" was selected, or
* - it's a forced sub and its language matches the audio's language, or
* - it's a default sub, or
* - its language matches the preferred subtitle's language (unequal to "original stream's language")
*/
PredicateSubtitleFilter(std::string& lang)
: audiolang(lang),
- original(StringUtils::EqualsNoCase(CSettings::Get().GetString("locale.subtitlelanguage"), "original")),
- preferexternal(CSettings::Get().GetBool("subtitles.preferexternal"))
+ original(StringUtils::EqualsNoCase(CSettings::Get().GetString("locale.subtitlelanguage"), "original"))
{
};
-
+
bool operator()(const SelectionStream& ss) const
{
if (ss.type_index == CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream)
return false;
- if (preferexternal)
- {
- if(STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_DEMUX_SUB || STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_TEXT)
- return false;
- }
+ if(STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_DEMUX_SUB || STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_TEXT)
+ return false;
if ((ss.flags & CDemuxStream::FLAG_FORCED) && (original || g_LangCodeExpander.CompareLangCodes(ss.language, audiolang)))
return false;
@@ -217,10 +212,9 @@ static bool PredicateAudioPriority(const SelectionStream& lh, const SelectionStr
*
* A subtitle lh is 'better than' a subtitle rh (in evaluation order) if
* - lh was previously selected, or
-* - lh is an external sub and "prefer external subs was selected" and rh not, or
+* - lh is an external sub and rh not, or
* - lh is a forced sub and ("original stream's language" was selected or subtitles are off) and rh not, or
* - lh is an external sub and its language matches the preferred subtitle's language (unequal to "original stream's language") and rh not, or
-* - lh is an external sub and rh not, or
* - lh is language matches the preferred subtitle's language (unequal to "original stream's language") and rh not, or
* - lh is a default sub and rh not
*/
@@ -229,14 +223,12 @@ class PredicateSubtitlePriority
private:
std::string audiolang;
bool original;
- bool preferextsubs;
bool subson;
PredicateSubtitleFilter filter;
public:
PredicateSubtitlePriority(std::string& lang)
: audiolang(lang),
original(StringUtils::EqualsNoCase(CSettings::Get().GetString("locale.subtitlelanguage"), "original")),
- preferextsubs(CSettings::Get().GetBool("subtitles.preferexternal")),
subson(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn),
filter(lang)
{
@@ -255,14 +247,12 @@ class PredicateSubtitlePriority
PREDICATE_RETURN(lh.type_index == CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream
, rh.type_index == CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream);
- if (preferextsubs)
- {
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_DEMUX_SUB
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB);
+ // prefer external subs
+ PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_DEMUX_SUB
+ , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB);
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_TEXT
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT);
- }
+ PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_TEXT
+ , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT);
if(!subson || original)
{
@@ -280,12 +270,6 @@ class PredicateSubtitlePriority
, (STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB || STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT) && g_LangCodeExpander.CompareLangCodes(subtitle_language, rh.language));
}
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_DEMUX_SUB
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB);
-
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_TEXT
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT);
-
if(!original)
{
PREDICATE_RETURN(g_LangCodeExpander.CompareLangCodes(subtitle_language, lh.language)
@@ -181,36 +181,31 @@ class PredicateSubtitleFilter
private:
std::string audiolang;
bool original;
- bool preferexternal;
public:
/** \brief The class' operator() decides if the given (subtitle) SelectionStream is relevant wrt.
* preferred subtitle language and audio language. If the subtitle is relevant <B>false</B> false is returned.
*
* A subtitle is relevant if
* - it was previously selected, or
- * - it's an external sub and "prefer external subs was selected", or
+ * - it's an external sub, or
* - it's a forced sub and "original stream's language" was selected, or
* - it's a forced sub and its language matches the audio's language, or
* - it's a default sub, or
* - its language matches the preferred subtitle's language (unequal to "original stream's language")
*/
PredicateSubtitleFilter(std::string& lang)
: audiolang(lang),
- original(StringUtils::EqualsNoCase(CSettings::Get().GetString("locale.subtitlelanguage"), "original")),
- preferexternal(CSettings::Get().GetBool("subtitles.preferexternal"))
+ original(StringUtils::EqualsNoCase(CSettings::Get().GetString("locale.subtitlelanguage"), "original"))
{
};
-
+
bool operator()(const OMXSelectionStream& ss) const
{
if (ss.type_index == CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream)
return false;
- if (preferexternal)
- {
- if(STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_DEMUX_SUB || STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_TEXT)
- return false;
- }
+ if(STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_DEMUX_SUB || STREAM_SOURCE_MASK(ss.source) == STREAM_SOURCE_TEXT)
+ return false;
if ((ss.flags & CDemuxStream::FLAG_FORCED) && (original || g_LangCodeExpander.CompareLangCodes(ss.language, audiolang)))
return false;
@@ -261,10 +256,9 @@ static bool PredicateAudioPriority(const OMXSelectionStream& lh, const OMXSelect
*
* A subtitle lh is 'better than' a subtitle rh (in evaluation order) if
* - lh was previously selected, or
-* - lh is an external sub and "prefer external subs was selected" and rh not, or
+* - lh is an external sub and rh not, or
* - lh is a forced sub and ("original stream's language" was selected or subtitles are off) and rh not, or
* - lh is an external sub and its language matches the preferred subtitle's language (unequal to "original stream's language") and rh not, or
-* - lh is an external sub and rh not, or
* - lh is language matches the preferred subtitle's language (unequal to "original stream's language") and rh not, or
* - lh is a default sub and rh not
*/
@@ -273,14 +267,12 @@ class PredicateSubtitlePriority
private:
std::string audiolang;
bool original;
- bool preferextsubs;
bool subson;
PredicateSubtitleFilter filter;
public:
PredicateSubtitlePriority(std::string& lang)
: audiolang(lang),
original(StringUtils::EqualsNoCase(CSettings::Get().GetString("locale.subtitlelanguage"), "original")),
- preferextsubs(CSettings::Get().GetBool("subtitles.preferexternal")),
subson(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn),
filter(lang)
{
@@ -299,14 +291,12 @@ class PredicateSubtitlePriority
PREDICATE_RETURN(lh.type_index == CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream
, rh.type_index == CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream);
- if (preferextsubs)
- {
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_DEMUX_SUB
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB);
+ // prefer external subs
+ PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_DEMUX_SUB
+ , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB);
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_TEXT
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT);
- }
+ PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_TEXT
+ , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT);
if(!subson || original)
{
@@ -324,12 +314,6 @@ class PredicateSubtitlePriority
, (STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB || STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT) && g_LangCodeExpander.CompareLangCodes(subtitle_language, rh.language));
}
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_DEMUX_SUB
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_DEMUX_SUB);
-
- PREDICATE_RETURN(STREAM_SOURCE_MASK(lh.source) == STREAM_SOURCE_TEXT
- , STREAM_SOURCE_MASK(rh.source) == STREAM_SOURCE_TEXT);
-
if(!original)
{
PREDICATE_RETURN(g_LangCodeExpander.CompareLangCodes(subtitle_language, lh.language)

0 comments on commit ba2c760

Please sign in to comment.