cleanup init functions of audio

- use SDL_bool if possible
- assume NULL/SDL_FALSE filled impl
- skip zfill of current_audio at the beginning of SDL_AudioInit (done before the init() calls)
This commit is contained in:
pionere 2022-01-17 11:21:01 +01:00 committed by Ryan C. Gordon
parent 6fcfcc3d6f
commit 0dda8a7f4c
31 changed files with 170 additions and 178 deletions

View file

@ -713,14 +713,14 @@ WASAPI_Deinitialize(void)
deviceid_list = NULL;
}
static int
static SDL_bool
WASAPI_Init(SDL_AudioDriverImpl * impl)
{
SDL_AtomicSet(&WASAPI_DefaultPlaybackGeneration, 1);
SDL_AtomicSet(&WASAPI_DefaultCaptureGeneration, 1);
if (WASAPI_PlatformInit() == -1) {
return 0;
return SDL_FALSE;
}
/* Set the function pointers */
@ -736,13 +736,13 @@ WASAPI_Init(SDL_AudioDriverImpl * impl)
impl->FlushCapture = WASAPI_FlushCapture;
impl->CloseDevice = WASAPI_CloseDevice;
impl->Deinitialize = WASAPI_Deinitialize;
impl->HasCaptureSupport = 1;
impl->HasCaptureSupport = SDL_TRUE;
return 1; /* this audio target is available. */
return SDL_TRUE; /* this audio target is available. */
}
AudioBootStrap WASAPI_bootstrap = {
"wasapi", "WASAPI", WASAPI_Init, 0
"wasapi", "WASAPI", WASAPI_Init, SDL_FALSE
};
#endif /* SDL_AUDIO_DRIVER_WASAPI */