mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-13 07:14:49 +00:00
check alcGetString return pointers
This commit is contained in:
parent
b86ec2ffcf
commit
5129d0da45
@ -26,18 +26,22 @@ void microphone_creator::refresh_list()
|
|||||||
|
|
||||||
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)
|
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)
|
||||||
{
|
{
|
||||||
const char* devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
|
if (const char* devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); devices != nullptr)
|
||||||
|
|
||||||
while (*devices != 0)
|
|
||||||
{
|
{
|
||||||
m_microphone_list.append(qstr(devices));
|
while (*devices != 0)
|
||||||
devices += strlen(devices) + 1;
|
{
|
||||||
|
m_microphone_list.append(qstr(devices));
|
||||||
|
devices += strlen(devices) + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Without enumeration we can only use one device
|
// Without enumeration we can only use one device
|
||||||
m_microphone_list.append(qstr(alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER)));
|
if (const char* device = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); device != nullptr)
|
||||||
|
{
|
||||||
|
m_microphone_list.append(qstr(device));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user