Only set a default slot for non-NULL effect types

This commit is contained in:
Chris Robinson 2012-02-18 17:09:08 -08:00
parent bbc679a5db
commit 6ac16867b4

View File

@ -2589,9 +2589,12 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->NumStereoSources = 1;
device->NumMonoSources = device->MaxNoOfSources - device->NumStereoSources;
if(ForcedEffect.type != AL_EFFECT_NULL)
{
device->DefaultSlot = (ALeffectslot*)(device+1);
if(InitEffectSlot(device->DefaultSlot) != AL_NO_ERROR)
device->DefaultSlot = NULL;
}
// Find a playback device to open
LockLists();