diff options
author | Andreas Zelend <ace20022@xbmc.org> | 2014-01-06 22:52:08 -0800 |
---|---|---|
committer | Andreas Zelend <ace20022@xbmc.org> | 2014-01-06 22:52:08 -0800 |
commit | c4251c386593349843bb2d8b8a0a413bcf5100c6 (patch) | |
tree | a8adb8e5cd197a7f8975c15511e918dc41c30ba4 | |
parent | 06a8d9447c29b0032f30ea8ad87b8b05f30f9ca8 (diff) | |
parent | 72247a9ec17ad1a8e1df5d0c1bc1e1628197380c (diff) |
Merge pull request #3945 from ace20022/sdsub
[Fix] Subtitle case of CStreamDetails::DetermineBestStreams
-rw-r--r-- | xbmc/utils/StreamDetails.cpp | 18 | ||||
-rw-r--r-- | xbmc/utils/StreamDetails.h | 3 |
2 files changed, 9 insertions, 12 deletions
diff --git a/xbmc/utils/StreamDetails.cpp b/xbmc/utils/StreamDetails.cpp index 9a11e50cf8..a64b5c01bb 100644 --- a/xbmc/utils/StreamDetails.cpp +++ b/xbmc/utils/StreamDetails.cpp @@ -22,6 +22,8 @@ #include "StreamDetails.h" #include "StreamUtils.h" #include "Variant.h" +#include "LangInfo.h" +#include "utils/LangCodeExpander.h" const float VIDEOASPECT_EPSILON = 0.025f; @@ -152,15 +154,13 @@ bool CStreamDetailSubtitle::IsWorseThan(CStreamDetail *that) if (that->m_eType != CStreamDetail::SUBTITLE) return true; - // the preferred subtitle should be the one in the user's language - if (m_pParent) - { - if (m_pParent->m_strLanguage == m_strLanguage) - return false; // already the best - else - return (m_pParent->m_strLanguage == ((CStreamDetailSubtitle *)that)->m_strLanguage); - } - return false; + if (g_LangCodeExpander.CompareLangCodes(m_strLanguage, ((CStreamDetailSubtitle *)that)->m_strLanguage)) + return false; + + // the best subtitle should be the one in the user's preferred language + // If preferred language is set to "original" this is "eng" + return m_strLanguage.empty() || + g_LangCodeExpander.CompareLangCodes(((CStreamDetailSubtitle *)that)->m_strLanguage, g_langInfo.GetSubtitleLanguage()); } CStreamDetailSubtitle& CStreamDetailSubtitle::operator=(const CStreamDetailSubtitle &that) diff --git a/xbmc/utils/StreamDetails.h b/xbmc/utils/StreamDetails.h index ddba84a545..b6306f5ce1 100644 --- a/xbmc/utils/StreamDetails.h +++ b/xbmc/utils/StreamDetails.h @@ -129,9 +129,6 @@ public: virtual void Archive(CArchive& ar); virtual void Serialize(CVariant& value) const; - // Language to use for "best" subtitle stream - CStdString m_strLanguage; - private: CStreamDetail *NewStream(CStreamDetail::StreamType type); std::vector<CStreamDetail *> m_vecItems; |