Skip to content

Commit

Permalink
Merge pull request xbmc#6513 from FernetMenta/avinfo
Browse files Browse the repository at this point in the history
dvdplayer: fix missing audio info
  • Loading branch information
FernetMenta committed Feb 22, 2015
2 parents 5c9c5d5 + c8da511 commit 10d8d19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
if(g_application.m_pPlayer->IsPlaying())
{
SPlayerAudioStreamInfo info;
g_application.m_pPlayer->GetAudioStreamInfo(g_application.m_pPlayer->GetAudioStream(), info);
g_application.m_pPlayer->GetAudioStreamInfo(CURRENT_STREAM, info);
strLabel = info.language;
}
break;
Expand Down Expand Up @@ -4368,7 +4368,7 @@ void CGUIInfoManager::UpdateAVInfo()
SPlayerAudioStreamInfo audio;

g_application.m_pPlayer->GetVideoStreamInfo(video);
g_application.m_pPlayer->GetAudioStreamInfo(g_application.m_pPlayer->GetAudioStream(), audio);
g_application.m_pPlayer->GetAudioStreamInfo(CURRENT_STREAM, audio);

m_videoInfo = video;
m_audioInfo = audio;
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/IPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "guilib/Geometry.h"
#include <string>

#define CURRENT_STREAM -1

struct TextCacheStruct_t;
class TiXmlElement;
class CStreamDetails;
Expand Down
3 changes: 3 additions & 0 deletions xbmc/cores/dvdplayer/DVDPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4156,6 +4156,9 @@ int CDVDPlayer::GetSourceBitrate()

void CDVDPlayer::GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info)
{
if (index == CURRENT_STREAM)
index = GetAudioStream();

if (index < 0 || index > GetAudioStreamCount() - 1 )
return;

Expand Down
3 changes: 1 addition & 2 deletions xbmc/video/dialogs/GUIDialogSubtitles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ void CGUIDialogSubtitles::Search(const std::string &search/*=""*/)
SPlayerAudioStreamInfo info;
std::string strLanguage;

int currentAudio = g_application.m_pPlayer->GetAudioStream();
g_application.m_pPlayer->GetAudioStreamInfo(currentAudio, info);
g_application.m_pPlayer->GetAudioStreamInfo(CURRENT_STREAM, info);

if (!g_LangCodeExpander.Lookup(strLanguage, info.language))
strLanguage = "Unknown";
Expand Down

0 comments on commit 10d8d19

Please sign in to comment.