Allow the backend init functions to return failure

This commit is contained in:
Chris Robinson 2011-08-17 06:05:26 -07:00
parent 14ffb8bd9b
commit 8148626ba3
16 changed files with 44 additions and 29 deletions

View File

@ -65,7 +65,7 @@ DEFINE_GUID(IID_IAudioRenderClient, 0xf294acfc, 0x3146, 0x4483, 0xa7,0xbf, 0xad,
#define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
typedef struct BackendInfo {
const char *name;
void (*Init)(BackendFuncs*);
ALCboolean (*Init)(BackendFuncs*);
void (*Deinit)(void);
void (*Probe)(enum DevProbe);
BackendFuncs Funcs;

View File

@ -1053,9 +1053,10 @@ static const BackendFuncs alsa_funcs = {
alsa_available_samples
};
void alc_alsa_init(BackendFuncs *func_list)
ALCboolean alc_alsa_init(BackendFuncs *func_list)
{
*func_list = alsa_funcs;
return ALC_TRUE;
}
void alc_alsa_deinit(void)

View File

@ -692,9 +692,10 @@ static const BackendFuncs ca_funcs = {
ca_available_samples
};
void alc_ca_init(BackendFuncs *func_list)
ALCboolean alc_ca_init(BackendFuncs *func_list)
{
*func_list = ca_funcs;
return ALC_TRUE;
}
void alc_ca_deinit(void)

View File

@ -610,9 +610,10 @@ static const BackendFuncs DSoundFuncs = {
};
void alcDSoundInit(BackendFuncs *FuncList)
ALCboolean alcDSoundInit(BackendFuncs *FuncList)
{
*FuncList = DSoundFuncs;
return ALC_TRUE;
}
void alcDSoundDeinit(void)

View File

@ -61,9 +61,10 @@ static const BackendFuncs loopback_funcs = {
NULL
};
void alc_loopback_init(BackendFuncs *func_list)
ALCboolean alc_loopback_init(BackendFuncs *func_list)
{
*func_list = loopback_funcs;
return ALC_TRUE;
}
void alc_loopback_deinit(void)

View File

@ -751,9 +751,10 @@ static const BackendFuncs MMDevApiFuncs = {
};
void alcMMDevApiInit(BackendFuncs *FuncList)
ALCboolean alcMMDevApiInit(BackendFuncs *FuncList)
{
*FuncList = MMDevApiFuncs;
return ALC_TRUE;
}
void alcMMDevApiDeinit(void)

View File

@ -146,9 +146,10 @@ static const BackendFuncs null_funcs = {
NULL
};
void alc_null_init(BackendFuncs *func_list)
ALCboolean alc_null_init(BackendFuncs *func_list)
{
*func_list = null_funcs;
return ALC_TRUE;
}
void alc_null_deinit(void)

View File

@ -406,9 +406,10 @@ static const BackendFuncs opensl_funcs = {
};
void alc_opensl_init(BackendFuncs *func_list)
ALCboolean alc_opensl_init(BackendFuncs *func_list)
{
*func_list = opensl_funcs;
return ALC_TRUE;
}
void alc_opensl_deinit(void)

View File

@ -489,9 +489,10 @@ static const BackendFuncs oss_funcs = {
oss_available_samples
};
void alc_oss_init(BackendFuncs *func_list)
ALCboolean alc_oss_init(BackendFuncs *func_list)
{
*func_list = oss_funcs;
return ALC_TRUE;
}
void alc_oss_deinit(void)

View File

@ -418,9 +418,10 @@ static const BackendFuncs pa_funcs = {
pa_available_samples
};
void alc_pa_init(BackendFuncs *func_list)
ALCboolean alc_pa_init(BackendFuncs *func_list)
{
*func_list = pa_funcs;
return ALC_TRUE;
}
void alc_pa_deinit(void)

View File

@ -1296,13 +1296,15 @@ static const BackendFuncs pulse_funcs = { //{{{
pulse_available_samples
}; //}}}
void alc_pulse_init(BackendFuncs *func_list) //{{{
ALCboolean alc_pulse_init(BackendFuncs *func_list) //{{{
{
*func_list = pulse_funcs;
pulse_ctx_flags = 0;
if(!GetConfigValueBool("pulse", "spawn-server", 0))
pulse_ctx_flags |= PA_CONTEXT_NOAUTOSPAWN;
return ALC_TRUE;
} //}}}
void alc_pulse_deinit(void) //{{{

View File

@ -360,9 +360,10 @@ static const BackendFuncs sndio_funcs = {
NULL
};
void alc_sndio_init(BackendFuncs *func_list)
ALCboolean alc_sndio_init(BackendFuncs *func_list)
{
*func_list = sndio_funcs;
return ALC_TRUE;
}
void alc_sndio_deinit(void)

View File

@ -286,9 +286,10 @@ static const BackendFuncs solaris_funcs = {
solaris_available_samples
};
void alc_solaris_init(BackendFuncs *func_list)
ALCboolean alc_solaris_init(BackendFuncs *func_list)
{
*func_list = solaris_funcs;
return ALC_TRUE;
}
void alc_solaris_deinit(void)

View File

@ -334,9 +334,10 @@ static const BackendFuncs wave_funcs = {
NULL
};
void alc_wave_init(BackendFuncs *func_list)
ALCboolean alc_wave_init(BackendFuncs *func_list)
{
*func_list = wave_funcs;
return ALC_TRUE;
}
void alc_wave_deinit(void)

View File

@ -719,9 +719,10 @@ static const BackendFuncs WinMMFuncs = {
WinMMAvailableSamples
};
void alcWinMMInit(BackendFuncs *FuncList)
ALCboolean alcWinMMInit(BackendFuncs *FuncList)
{
*FuncList = WinMMFuncs;
return ALC_TRUE;
}
void alcWinMMDeinit()

View File

@ -279,46 +279,46 @@ enum DevProbe {
CAPTURE_DEVICE_PROBE
};
void alc_alsa_init(BackendFuncs *func_list);
ALCboolean alc_alsa_init(BackendFuncs *func_list);
void alc_alsa_deinit(void);
void alc_alsa_probe(enum DevProbe type);
void alc_oss_init(BackendFuncs *func_list);
ALCboolean alc_oss_init(BackendFuncs *func_list);
void alc_oss_deinit(void);
void alc_oss_probe(enum DevProbe type);
void alc_solaris_init(BackendFuncs *func_list);
ALCboolean alc_solaris_init(BackendFuncs *func_list);
void alc_solaris_deinit(void);
void alc_solaris_probe(enum DevProbe type);
void alc_sndio_init(BackendFuncs *func_list);
ALCboolean alc_sndio_init(BackendFuncs *func_list);
void alc_sndio_deinit(void);
void alc_sndio_probe(enum DevProbe type);
void alcMMDevApiInit(BackendFuncs *func_list);
ALCboolean alcMMDevApiInit(BackendFuncs *func_list);
void alcMMDevApiDeinit(void);
void alcMMDevApiProbe(enum DevProbe type);
void alcDSoundInit(BackendFuncs *func_list);
ALCboolean alcDSoundInit(BackendFuncs *func_list);
void alcDSoundDeinit(void);
void alcDSoundProbe(enum DevProbe type);
void alcWinMMInit(BackendFuncs *FuncList);
ALCboolean alcWinMMInit(BackendFuncs *FuncList);
void alcWinMMDeinit(void);
void alcWinMMProbe(enum DevProbe type);
void alc_pa_init(BackendFuncs *func_list);
ALCboolean alc_pa_init(BackendFuncs *func_list);
void alc_pa_deinit(void);
void alc_pa_probe(enum DevProbe type);
void alc_wave_init(BackendFuncs *func_list);
ALCboolean alc_wave_init(BackendFuncs *func_list);
void alc_wave_deinit(void);
void alc_wave_probe(enum DevProbe type);
void alc_pulse_init(BackendFuncs *func_list);
ALCboolean alc_pulse_init(BackendFuncs *func_list);
void alc_pulse_deinit(void);
void alc_pulse_probe(enum DevProbe type);
void alc_ca_init(BackendFuncs *func_list);
ALCboolean alc_ca_init(BackendFuncs *func_list);
void alc_ca_deinit(void);
void alc_ca_probe(enum DevProbe type);
void alc_opensl_init(BackendFuncs *func_list);
ALCboolean alc_opensl_init(BackendFuncs *func_list);
void alc_opensl_deinit(void);
void alc_opensl_probe(enum DevProbe type);
void alc_null_init(BackendFuncs *func_list);
ALCboolean alc_null_init(BackendFuncs *func_list);
void alc_null_deinit(void);
void alc_null_probe(enum DevProbe type);
void alc_loopback_init(BackendFuncs *func_list);
ALCboolean alc_loopback_init(BackendFuncs *func_list);
void alc_loopback_deinit(void);
void alc_loopback_probe(enum DevProbe type);