/* MAKE SURE you hold the audio lock (SDL_LockAudio()) before calling this! */ int _Mix_UnregisterEffect_locked(int channel, Mix_EffectFunc_t f) { effect_info **e = NULL; if (channel == MIX_CHANNEL_POST) { e = &posteffects; } else { if ((channel < 0) || (channel >= num_channels)) { Mix_SetError("Invalid channel number"); return(0); } e = &mix_channel[channel].effects; } return _Mix_remove_effect(channel, e, f); }
int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f) { effect_info **e = NULL; int retval; if (channel == MIX_CHANNEL_POST) { e = &posteffects; } else { if ((channel < 0) || (channel >= num_channels)) { Mix_SetError("Invalid channel number"); return(0); } e = &mix_channel[channel].effects; } SDL_LockAudio(); retval = _Mix_remove_effect(channel, e, f); SDL_UnlockAudio(); return(retval); }