mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 23:02:01 +00:00
Fix crash in OpenAL when no input devices are available
This commit is contained in:
parent
f6f3a19f73
commit
efe8437cde
1 changed files with 8 additions and 5 deletions
|
@ -2667,12 +2667,15 @@ qboolean S_AL_Init( soundInterface_t *si )
|
||||||
defaultinputdevice = qalcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
|
defaultinputdevice = qalcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
|
||||||
|
|
||||||
// dump a list of available devices to a cvar for the user to see.
|
// dump a list of available devices to a cvar for the user to see.
|
||||||
|
if (inputdevicelist)
|
||||||
|
{
|
||||||
while((curlen = strlen(inputdevicelist)))
|
while((curlen = strlen(inputdevicelist)))
|
||||||
{
|
{
|
||||||
Q_strcat(inputdevicenames, sizeof(inputdevicenames), inputdevicelist);
|
Q_strcat(inputdevicenames, sizeof(inputdevicenames), inputdevicelist);
|
||||||
Q_strcat(inputdevicenames, sizeof(inputdevicenames), "\n");
|
Q_strcat(inputdevicenames, sizeof(inputdevicenames), "\n");
|
||||||
inputdevicelist += curlen + 1;
|
inputdevicelist += curlen + 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s_alAvailableInputDevices = Cvar_Get("s_alAvailableInputDevices", inputdevicenames, CVAR_ROM | CVAR_NORESTART);
|
s_alAvailableInputDevices = Cvar_Get("s_alAvailableInputDevices", inputdevicenames, CVAR_ROM | CVAR_NORESTART);
|
||||||
|
|
||||||
|
@ -2680,7 +2683,7 @@ qboolean S_AL_Init( soundInterface_t *si )
|
||||||
// !!! FIXME: should probably open the capture device after
|
// !!! FIXME: should probably open the capture device after
|
||||||
// !!! FIXME: initializing Speex so we can change to wideband
|
// !!! FIXME: initializing Speex so we can change to wideband
|
||||||
// !!! FIXME: if we like.
|
// !!! FIXME: if we like.
|
||||||
Com_Printf("OpenAL default capture device is '%s'\n", defaultinputdevice);
|
Com_Printf("OpenAL default capture device is '%s'\n", defaultinputdevice ? defaultinputdevice : "none");
|
||||||
alCaptureDevice = qalcCaptureOpenDevice(inputdevice, 8000, AL_FORMAT_MONO16, 4096);
|
alCaptureDevice = qalcCaptureOpenDevice(inputdevice, 8000, AL_FORMAT_MONO16, 4096);
|
||||||
if( !alCaptureDevice && inputdevice )
|
if( !alCaptureDevice && inputdevice )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue