Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[AE/CA] - on LPCM only set audio-midi-setup to 8 channels when needed…

… based on the channelcount of the stream with the highest channelcount - else set it to 2 channels if stream is only 2.0. This allows amps to switch to stereo enhancing modes (e.x. DPII) when playing 2.0 over LPCM (e.x. AAC 2.0).
  • Loading branch information...
commit 44f0991a2f2a8449e6f8fe1869304872e186269a 1 parent 555cf97
@Memphiz Memphiz authored
Showing with 15 additions and 2 deletions.
  1. +15 −2 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
View
17 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
@@ -173,7 +173,7 @@ bool CCoreAudioAE::Initialize()
bool CCoreAudioAE::OpenCoreAudio(unsigned int sampleRate, bool forceRaw,
enum AEDataFormat rawDataFormat)
{
-
+ unsigned int maxChannelCountInStreams = 0;
// remove any deleted streams
CSingleLock streamLock(m_streamLock);
for (StreamList::iterator itt = m_streams.begin(); itt != m_streams.end();)
@@ -190,6 +190,10 @@ bool CCoreAudioAE::OpenCoreAudio(unsigned int sampleRate, bool forceRaw,
// close all converter
stream->CloseConverter();
}
+
+ if (stream->GetChannelCount() > maxChannelCountInStreams)
+ maxChannelCountInStreams = stream->GetChannelCount();
+
++itt;
}
@@ -263,7 +267,16 @@ bool CCoreAudioAE::OpenCoreAudio(unsigned int sampleRate, bool forceRaw,
m_format.m_dataFormat = AE_FMT_S16NE;
break;
case AE_FMT_LPCM:
- m_format.m_channelLayout = CAEChannelInfo(AE_CH_LAYOUT_7_1);
+ // audio midi setup can be setup to 2.0 or 7.1
+ // if we have the number of max channels from streams we use that for
+ // selecting either 2.0 or 7.1 setup depending on that.
+ // This allows DPII modes on amps for enhancing stereo sound
+ // (when switching to 7.1 - all 8 channels will be pushed out preventing most amps
+ // to switch to DPII mode)
+ if (maxChannelCountInStreams == 1 || maxChannelCountInStreams == 2)
+ m_format.m_channelLayout = CAEChannelInfo(AE_CH_LAYOUT_2_0);
+ else
+ m_format.m_channelLayout = CAEChannelInfo(AE_CH_LAYOUT_7_1);
m_format.m_sampleRate = sampleRate;
m_format.m_dataFormat = AE_FMT_FLOAT;
break;
Please sign in to comment.
Something went wrong with that request. Please try again.