Skip to content

Commit

Permalink
CoreAE: mixerunits input is the inputunits output
Browse files Browse the repository at this point in the history
Not this still doesn't resolve all issues. We are still not
setting up a correct channel map for the output
  • Loading branch information
elupus committed Mar 17, 2013
1 parent ce64738 commit 89bd125
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioGraph.cpp
Expand Up @@ -154,9 +154,10 @@ bool CCoreAudioGraph::Open(ICoreAudioSource *pSource, AEAudioFormat &format,

// Update format structure to reflect the desired format from the mixer
// The output format of the mixer is identical to the input format, except for the channel count
fmt.mChannelsPerFrame = m_mixMap->GetOutputChannels();
AudioStreamBasicDescription mixOutput(fmt);
mixOutput.mChannelsPerFrame = m_mixMap->GetOutputChannels();

if (!m_mixerUnit->SetFormat(&fmt, kAudioUnitScope_Output, kOutputBus))
if (!m_mixerUnit->SetFormat(&mixOutput, kAudioUnitScope_Output, kOutputBus))
return false;

ret = AUGraphConnectNodeInput(m_audioGraph, m_mixerUnit->GetNode(), 0, m_audioUnit->GetNode(), 0);
Expand Down Expand Up @@ -199,11 +200,11 @@ bool CCoreAudioGraph::Open(ICoreAudioSource *pSource, AEAudioFormat &format,

UInt32 inputNumber = m_inputUnit->GetBus();
int channelOffset = GetMixerChannelOffset(inputNumber);
if (!CCoreAudioMixMap::SetMixingMatrix(m_mixerUnit, m_mixMap, &inputFormat, &fmt, channelOffset))
if (!CCoreAudioMixMap::SetMixingMatrix(m_mixerUnit, m_mixMap, &fmt, &mixOutput, channelOffset))
return false;

// Regenerate audio format and copy format for the Output AU
outputFormat = fmt;
outputFormat = mixOutput;
}
else
{
Expand Down

0 comments on commit 89bd125

Please sign in to comment.