diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index e654d5ef8..be10b4b17 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -308,10 +308,10 @@ expression e; + SDL_PauseAudioDevice(e) | - SDL_PauseAudioDevice(e, 0) -+ SDL_UnpauseAudioDevice(e) ++ SDL_ResumeAudioDevice(e) | - SDL_PauseAudioDevice(e, SDL_FALSE) -+ SDL_UnpauseAudioDevice(e) ++ SDL_ResumeAudioDevice(e) ) @@ @@ -321,7 +321,7 @@ expression e, pause_on; + if (pause_on) { + SDL_PauseAudioDevice(e); + } else { -+ SDL_UnpauseAudioDevice(e); ++ SDL_ResumeAudioDevice(e); + } diff --git a/docs/README-migration.md b/docs/README-migration.md index c3e2f01b3..70704d127 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -148,7 +148,7 @@ Rather than iterating over audio devices using a device index, there is a new fu SDL_LockAudioDevice() and SDL_UnlockAudioDevice() have been removed, since there is no callback in another thread to protect. SDL's audio subsystem and SDL_AudioStream maintain their own locks internally, so audio streams are safe to use from any thread. If the app assigns a callback to a specific stream, it can use the stream's lock through SDL_LockAudioStream() if necessary. -SDL_PauseAudioDevice() no longer takes a second argument; it always pauses the device. To unpause, use SDL_UnpauseAudioDevice(). +SDL_PauseAudioDevice() no longer takes a second argument; it always pauses the device. To unpause, use SDL_ResumeAudioDevice(). Audio devices, opened by SDL_OpenAudioDevice(), no longer start in a paused state, as they don't begin processing audio until a stream is bound. diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 879e3a56d..fbef62360 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -438,7 +438,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID * * \since This function is available since SDL 3.0.0. * - * \sa SDL_UnpauseAudioDevice + * \sa SDL_ResumeAudioDevice * \sa SDL_IsAudioDevicePaused */ extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev); @@ -466,10 +466,10 @@ extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_UnpauseAudioDevice + * \sa SDL_ResumeAudioDevice * \sa SDL_IsAudioDevicePaused */ -extern DECLSPEC int SDLCALL SDL_UnpauseAudioDevice(SDL_AudioDeviceID dev); +extern DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); /** * Use this function to query if an audio device is paused. @@ -489,7 +489,7 @@ extern DECLSPEC int SDLCALL SDL_UnpauseAudioDevice(SDL_AudioDeviceID dev); * \since This function is available since SDL 3.0.0. * * \sa SDL_PauseAudioDevice - * \sa SDL_UnpauseAudioDevice + * \sa SDL_ResumeAudioDevice * \sa SDL_IsAudioDevicePaused */ extern DECLSPEC SDL_bool SDLCALL SDL_IsAudioDevicePaused(SDL_AudioDeviceID dev); diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index bacd4b89c..c41627386 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1322,7 +1322,7 @@ int SDL_PauseAudioDevice(SDL_AudioDeviceID devid) return SetLogicalAudioDevicePauseState(devid, 1); } -int SDLCALL SDL_UnpauseAudioDevice(SDL_AudioDeviceID devid) +int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid) { return SetLogicalAudioDevicePauseState(devid, 0); } diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 59123eaa1..e30c475b9 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -884,7 +884,7 @@ SDL3_0.0.0 { SDL_GetSilenceValueForFormat; SDL_LoadWAV; SDL_PauseAudioDevice; - SDL_UnpauseAudioDevice; + SDL_ResumeAudioDevice; SDL_IsAudioDevicePaused; SDL_GetAudioStreamBinding; SDL_ShowWindowSystemMenu; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index da10b9911..dbd4773d8 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -909,7 +909,7 @@ #define SDL_GetSilenceValueForFormat SDL_GetSilenceValueForFormat_REAL #define SDL_LoadWAV SDL_LoadWAV_REAL #define SDL_PauseAudioDevice SDL_PauseAudioDevice_REAL -#define SDL_UnpauseAudioDevice SDL_UnpauseAudioDevice_REAL +#define SDL_ResumeAudioDevice SDL_ResumeAudioDevice_REAL #define SDL_IsAudioDevicePaused SDL_IsAudioDevicePaused_REAL #define SDL_GetAudioStreamBinding SDL_GetAudioStreamBinding_REAL #define SDL_ShowWindowSystemMenu SDL_ShowWindowSystemMenu_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 5d27dd18f..5d3b30aae 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -953,7 +953,7 @@ SDL_DYNAPI_PROC(int,SDL_ConvertAudioSamples,(const SDL_AudioSpec *a, const Uint8 SDL_DYNAPI_PROC(int,SDL_GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return) SDL_DYNAPI_PROC(int,SDL_LoadWAV,(const char *a, SDL_AudioSpec *b, Uint8 **c, Uint32 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_PauseAudioDevice,(SDL_AudioDeviceID a),(a),return) -SDL_DYNAPI_PROC(int,SDL_UnpauseAudioDevice,(SDL_AudioDeviceID a),(a),return) +SDL_DYNAPI_PROC(int,SDL_ResumeAudioDevice,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_IsAudioDevicePaused,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_GetAudioStreamBinding,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b,c),return) diff --git a/test/testaudiocapture.c b/test/testaudiocapture.c index 87ee24c4b..8755079b4 100644 --- a/test/testaudiocapture.c +++ b/test/testaudiocapture.c @@ -43,13 +43,13 @@ static void loop(void) } else if (e.type == SDL_EVENT_MOUSE_BUTTON_DOWN) { if (e.button.button == 1) { SDL_PauseAudioDevice(devid_out); - SDL_UnpauseAudioDevice(devid_in); + SDL_ResumeAudioDevice(devid_in); } } else if (e.type == SDL_EVENT_MOUSE_BUTTON_UP) { if (e.button.button == 1) { SDL_PauseAudioDevice(devid_in); SDL_FlushAudioStream(stream_in); /* so no samples are held back for resampling purposes. */ - SDL_UnpauseAudioDevice(devid_out); + SDL_ResumeAudioDevice(devid_out); } } } diff --git a/test/testmultiaudio.c b/test/testmultiaudio.c index 8a26c6f55..b75da9468 100644 --- a/test/testmultiaudio.c +++ b/test/testmultiaudio.c @@ -123,7 +123,7 @@ test_multi_audio(SDL_AudioDeviceID *devices, int devcount) /* try to start all the devices about the same time. SDL does not guarantee sync across physical devices. */ for (i = 0; i < devcount; i++) { if (devices[i]) { - SDL_UnpauseAudioDevice(devices[i]); + SDL_ResumeAudioDevice(devices[i]); } }