--- linuxsampler/trunk/src/engines/gig/InstrumentResourceManager.cpp 2011/11/24 14:30:58 2290 +++ linuxsampler/trunk/src/engines/gig/InstrumentResourceManager.cpp 2011/11/24 17:00:29 2291 @@ -604,9 +604,8 @@ // (try to resolve the audio device context) EngineChannel* pEngineChannel = dynamic_cast(pConsumer); - AudioOutputDevice* pDevice = - (pEngineChannel) ? dynamic_cast(pEngineChannel->GetEngine())->pAudioOutputDevice : NULL; - + Engine* pEngine = dynamic_cast(pEngineChannel->GetEngine()); + AudioOutputDevice* pDevice = (pEngine) ? pEngine->pAudioOutputDevice : NULL; // and we save this to check if we need to reallocate for a engine with higher value of 'MaxSamplesPerSecond' pEntry->MaxSamplesPerCycle = (pDevice) ? pDevice->MaxSamplesPerCycle() : DefaultMaxSamplesPerCycle(); @@ -628,8 +627,8 @@ // (try to resolve the audio device context) EngineChannel* pEngineChannel = dynamic_cast(pConsumer); - AudioOutputDevice* pDevice = - (pEngineChannel) ? dynamic_cast(pEngineChannel->GetEngine())->pAudioOutputDevice : NULL; + Engine* pEngine = dynamic_cast(pEngineChannel->GetEngine()); + AudioOutputDevice* pDevice = (pEngine) ? pEngine->pAudioOutputDevice : NULL; uint maxSamplesPerCycle = (pDevice) ? pDevice->MaxSamplesPerCycle() : DefaultMaxSamplesPerCycle();