diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 8926b7e000..d60ccb5f2e 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -198,7 +198,7 @@ static void DestroyPhysicalAudioDevice(SDL_AudioDevice *device) // it's safe to not hold the lock for this (we can't anyhow, or the audio thread won't quit), because we shouldn't be in the device list at this point. ClosePhysicalAudioDevice(device); - current_audio.impl.FreeDeviceHandle(device->handle); + current_audio.impl.FreeDeviceHandle(device); SDL_DestroyMutex(device->lock); SDL_free(device->work_buffer); @@ -418,7 +418,7 @@ static void SDL_AudioWaitCaptureDevice_Default(SDL_AudioDevice *device) { /* no- static void SDL_AudioFlushCapture_Default(SDL_AudioDevice *device) { /* no-op. */ } static void SDL_AudioCloseDevice_Default(SDL_AudioDevice *device) { /* no-op. */ } static void SDL_AudioDeinitialize_Default(void) { /* no-op. */ } -static void SDL_AudioFreeDeviceHandle_Default(void *handle) { /* no-op. */ } +static void SDL_AudioFreeDeviceHandle_Default(SDL_AudioDevice *device) { /* no-op. */ } static void SDL_AudioDetectDevices_Default(SDL_AudioDevice **default_output, SDL_AudioDevice **default_capture) { diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index ca71097fb7..ff3d1755c8 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -114,7 +114,7 @@ typedef struct SDL_AudioDriverImpl int (*CaptureFromDevice)(SDL_AudioDevice *device, void *buffer, int buflen); void (*FlushCapture)(SDL_AudioDevice *device); void (*CloseDevice)(SDL_AudioDevice *device); - void (*FreeDeviceHandle)(void *handle); /**< SDL is done with handle from SDL_AddAudioDevice() */ + void (*FreeDeviceHandle)(SDL_AudioDevice *handle); // SDL is done with this device; free the handle from SDL_AddAudioDevice() void (*Deinitialize)(void); /* Some flags to push duplicate code into the core and reduce #ifdefs. */ diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c index 33ad196451..17fef74bf7 100644 --- a/src/audio/directsound/SDL_directsound.c +++ b/src/audio/directsound/SDL_directsound.c @@ -149,9 +149,9 @@ static int SetDSerror(const char *function, int code) return SDL_SetError("%s: %s (0x%x)", function, error, code); } -static void DSOUND_FreeDeviceHandle(void *handle) +static void DSOUND_FreeDeviceHandle(SDL_AudioDevice *device) { - SDL_free(handle); + SDL_free(device->handle); } static int DSOUND_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture)