aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2014-08-18 08:53:43 +0200
committerRainer Hochecker <fernetmenta@online.de>2014-08-18 08:53:43 +0200
commit879b95349a87dfd5abdf22fd866dbd7b1f9aca5b (patch)
treebf3bbc415ebb60d3041c8dfbd732ea91dfaf1b70
parentfbf151589a920203d5d69e949e8ee43edae59b4a (diff)
parent87b7c1792974dd858242d2031963df520a3a175e (diff)
Merge pull request #5079 from FernetMenta/channels
dvdplayer: fix incorrect display of audio channels
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayer.cpp7
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayerAudio.cpp7
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayerAudio.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index 416ad2fe46..8de1e96508 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -3774,12 +3774,18 @@ void CDVDPlayer::GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info)
return;
if (index == GetAudioStream())
+ {
info.bitrate = m_dvdPlayerAudio.GetAudioBitrate();
+ info.channels = m_dvdPlayerAudio.GetAudioChannels();
+ }
else if (m_pDemuxer)
{
CDemuxStreamAudio* stream = m_pDemuxer->GetStreamFromAudioId(index);
if (stream)
+ {
info.bitrate = stream->iBitRate;
+ info.channels = stream->iChannels;
+ }
}
SelectionStream& s = m_SelectionStreams.Get(STREAM_AUDIO, index);
@@ -3797,7 +3803,6 @@ void CDVDPlayer::GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info)
CDemuxStreamAudio* stream = static_cast<CDemuxStreamAudio*>(m_pDemuxer->GetStreamFromAudioId(index));
if (stream)
{
- info.channels = stream->iChannels;
std::string codecName;
m_pDemuxer->GetStreamCodecName(stream->iId, codecName);
info.audioCodecName = codecName;
diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
index e4c6089dc3..120cdde389 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
@@ -552,6 +552,8 @@ void CDVDPlayerAudio::Process()
if(!m_dvdAudio.Create(audioframe, m_streaminfo.codec, m_setsynctype == SYNC_RESAMPLE))
CLog::Log(LOGERROR, "%s - failed to create audio renderer", __FUNCTION__);
+
+ m_streaminfo.channels = audioframe.channel_count;
}
// Zero out the frame data if we are supposed to silence the audio
@@ -798,6 +800,11 @@ int CDVDPlayerAudio::GetAudioBitrate()
return (int)m_audioStats.GetBitrate();
}
+int CDVDPlayerAudio::GetAudioChannels()
+{
+ return m_streaminfo.channels;
+}
+
bool CDVDPlayerAudio::IsPassthrough() const
{
CSingleLock lock(m_info_section);
diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPlayerAudio.h
index 3f13c5a792..3761912a5d 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h
+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h
@@ -133,6 +133,7 @@ public:
std::string GetPlayerInfo();
int GetAudioBitrate();
+ int GetAudioChannels();
// holds stream information for current playing stream
CDVDStreamInfo m_streaminfo;