diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2014-07-22 15:36:31 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2014-07-22 16:09:36 +0200 |
commit | 87b7c1792974dd858242d2031963df520a3a175e (patch) | |
tree | 6c476c9354678f3ed31c7712aa55eba91ea4663b | |
parent | 778b92ebb6f6aee0728e9e95d99ad6da08efd313 (diff) |
dvdplayer: get number of channels for active audio stream from audio player, ffmpeg demuxer does not update this info for codecs like AAC
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayer.cpp | 7 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 7 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayerAudio.h | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index 93df78cc9b..e0f54a7c48 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 3141a9b269..68ec63d7cc 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 2a1b564940..ec9570a28f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h @@ -136,6 +136,7 @@ public: std::string GetPlayerInfo(); int GetAudioBitrate(); + int GetAudioChannels(); // holds stream information for current playing stream CDVDStreamInfo m_streaminfo; |