mirror of
https://github.com/encounter/SDL.git
synced 2025-12-18 17:35:39 +00:00
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:
@@ -293,11 +293,11 @@ ESD_Deinitialize(void)
|
||||
UnloadESDLibrary();
|
||||
}
|
||||
|
||||
static int
|
||||
static SDL_bool
|
||||
ESD_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
if (LoadESDLibrary() < 0) {
|
||||
return 0;
|
||||
return SDL_FALSE;
|
||||
} else {
|
||||
int connection = 0;
|
||||
|
||||
@@ -308,7 +308,7 @@ ESD_Init(SDL_AudioDriverImpl * impl)
|
||||
if (connection < 0) {
|
||||
UnloadESDLibrary();
|
||||
SDL_SetError("ESD: esd_open_sound failed (no audio server?)");
|
||||
return 0;
|
||||
return SDL_FALSE;
|
||||
}
|
||||
SDL_NAME(esd_close) (connection);
|
||||
}
|
||||
@@ -320,14 +320,14 @@ ESD_Init(SDL_AudioDriverImpl * impl)
|
||||
impl->GetDeviceBuf = ESD_GetDeviceBuf;
|
||||
impl->CloseDevice = ESD_CloseDevice;
|
||||
impl->Deinitialize = ESD_Deinitialize;
|
||||
impl->OnlyHasDefaultOutputDevice = 1;
|
||||
impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
|
||||
|
||||
return 1; /* this audio target is available. */
|
||||
return SDL_TRUE; /* this audio target is available. */
|
||||
}
|
||||
|
||||
|
||||
AudioBootStrap ESD_bootstrap = {
|
||||
"esd", "Enlightened Sound Daemon", ESD_Init, 0
|
||||
"esd", "Enlightened Sound Daemon", ESD_Init, SDL_FALSE
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_ESD */
|
||||
|
||||
Reference in New Issue
Block a user