Skip to content

Commit

Permalink
Merge pull request #3945 from ace20022/sdsub
Browse files Browse the repository at this point in the history
[Fix] Subtitle case of CStreamDetails::DetermineBestStreams
  • Loading branch information
ace20022 committed Jan 7, 2014
2 parents 06a8d94 + 72247a9 commit c4251c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
18 changes: 9 additions & 9 deletions xbmc/utils/StreamDetails.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions xbmc/utils/StreamDetails.h
Expand Up @@ -129,9 +129,6 @@ class CStreamDetails : public IArchivable, public ISerializable
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;
Expand Down

0 comments on commit c4251c3

Please sign in to comment.