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)
|
||||
{
|
||||
const char* devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
|
||||
|
||||
while (*devices != 0)
|
||||
if (const char* devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); devices != nullptr)
|
||||
{
|
||||
m_microphone_list.append(qstr(devices));
|
||||
devices += strlen(devices) + 1;
|
||||
while (*devices != 0)
|
||||
{
|
||||
m_microphone_list.append(qstr(devices));
|
||||
devices += strlen(devices) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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