Permalink
Browse files

[Player] Return the language code of a stream, or its name if the lan…

…guage is not specified.
  • Loading branch information...
1 parent 33b0427 commit 93e562f499586b15a4e6ea0ab4adaebfa02d0ef1 @ace20022 committed Mar 4, 2013
Showing with 12 additions and 14 deletions.
  1. +12 −14 xbmc/interfaces/legacy/Player.cpp
@@ -28,7 +28,6 @@
#include "ApplicationMessenger.h"
#include "GUIInfoManager.h"
#include "AddonUtils.h"
-#include "utils/LangCodeExpander.h"
#include "utils/log.h"
#include "cores/IPlayer.h"
@@ -396,11 +395,11 @@ namespace XBMCAddon
{
SPlayerSubtitleStreamInfo info;
g_application.m_pPlayer->GetSubtitleStreamInfo(g_application.m_pPlayer->GetSubtitle(), info);
- CStdString strName = info.name;
- if (strName == "Unknown(Invalid)")
- strName = "";
- return strName;
+ if (info.language.length() > 0)
+ return info.language;
+ else
+ return info.name;
}
return NULL;
@@ -428,10 +427,10 @@ namespace XBMCAddon
SPlayerSubtitleStreamInfo info;
g_application.m_pPlayer->GetSubtitleStreamInfo(iStream, info);
- CStdString FullLang;
- if (!g_LangCodeExpander.Lookup(FullLang, info.name))
- FullLang = info.name;
- (*ret)[iStream] = FullLang;
+ if (info.language.length() > 0)
+ (*ret)[iStream] = info.language;
+ else
+ (*ret)[iStream] = info.name;
}
return ret;
}
@@ -463,11 +462,10 @@ namespace XBMCAddon
SPlayerAudioStreamInfo info;
g_application.m_pPlayer->GetAudioStreamInfo(iStream, info);
- CStdString FullLang;
- g_LangCodeExpander.Lookup(FullLang, info.language);
- if (FullLang.IsEmpty())
- FullLang = info.name;
- (*ret)[iStream] = FullLang;
+ if (info.language.length() > 0)
+ (*ret)[iStream] = info.language;
+ else
+ (*ret)[iStream] = info.name;
}
return ret;
}

0 comments on commit 93e562f

Please sign in to comment.