Bug #620 Fixed crash when no audio devices are present (#118)

This commit is contained in:
Krystian Booker 2022-08-30 08:10:05 -04:00 committed by GitHub
parent 2d42c885da
commit 60074c440d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -226,6 +226,11 @@ std::vector<DirectSoundAPI::DeviceDescriptionPtr> DirectSoundAPI::GetDevices()
return TRUE;
}, &result);
//Exclude default primary sound device if no other sound devices are available
if (result.size() == 1 && result.at(0).get()->GetIdentifier() == L"default") {
result.clear();
}
return result;
}