Starting a fix for explicit receivers in binaural free-field renderer

parent 3e2ad198
......@@ -583,7 +583,11 @@ void CVABinauralFreeFieldAudioRenderer::ManageSoundPaths( const CVASceneState* p
while( citr != pDiff->viNewReceiverIDs.end() )
{
const int& iID( *citr++ );
CVABFFListener* pListener = CreateListener( iID, pNewScene->GetReceiverState( iID ) );
// Only add, if no other renderer has been connected explicitly with this receiver
const auto pReceiverDesc = m_pCore->GetSceneManager()->GetListenerDesc( iID );
if( pReceiverDesc->sExplicitRendererID.empty() || pReceiverDesc->sExplicitRendererID == m_oParams.sID )
CVABFFListener* pListener = CreateListener( iID, pNewScene->GetReceiverState( iID ) );
}
// New paths: (1) new receivers, current sources
......@@ -591,6 +595,11 @@ void CVABinauralFreeFieldAudioRenderer::ManageSoundPaths( const CVASceneState* p
while( citr != pDiff->viNewReceiverIDs.end() )
{
int iListenerID = ( *citr++ );
const auto pReceiverDesc = m_pCore->GetSceneManager()->GetListenerDesc( iListenerID );
if( !pReceiverDesc->sExplicitRendererID.empty() && pReceiverDesc->sExplicitRendererID != m_oParams.sID )
continue;
CVABFFListener* pListener = m_mListeners[ iListenerID ];
for( size_t i = 0; i < pDiff->viComSoundSourceIDs.size(); i++ )
......@@ -623,9 +632,13 @@ void CVABinauralFreeFieldAudioRenderer::ManageSoundPaths( const CVASceneState* p
for( size_t i = 0; i < pDiff->viComReceiverIDs.size(); i++ )
{
int iListenerID = pDiff->viComReceiverIDs[ i ];
CVABFFListener* pListener = m_mListeners[ iListenerID ];
if( !pListener->bDeleted )
CVABFFSoundPath* pPath = CreateSoundPath( pSource, pListener );
auto it = m_mListeners.find( iListenerID );
if( it != m_mListeners.end() )
{
CVABFFListener* pListener( it->second );
if( !pListener->bDeleted )
CVABFFSoundPath* pPath = CreateSoundPath( pSource, pListener );
}
}
}
......@@ -646,12 +659,15 @@ void CVABinauralFreeFieldAudioRenderer::ManageSoundPaths( const CVASceneState* p
while( citr != pDiff->viNewReceiverIDs.end() )
{
const int& iListenerID( *citr++ );
CVABFFListener* pListener = m_mListeners[ iListenerID ];
CVABFFSoundPath* pPath = CreateSoundPath( pSource, pListener );
auto it = m_mListeners.find( iListenerID );
if( it != m_mListeners.end() )
{
CVABFFListener* pListener( it->second );
CVABFFSoundPath* pPath = CreateSoundPath( pSource, pListener );
}
}
}
return;
}
void CVABinauralFreeFieldAudioRenderer::ProcessStream( const ITAStreamInfo* pStreamInfo )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment