Browse Source
Merge pull request #9080 from lat9nq/sdl-audio-not-null
sdl2_sink: Avoid loading a null string into a vector
pull/15/merge
Morph
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
src/audio_core/sink/sdl2_sink.cpp
|
|
|
@ -230,7 +230,9 @@ std::vector<std::string> ListSDLSinkDevices(bool capture) { |
|
|
|
|
|
|
|
const int device_count = SDL_GetNumAudioDevices(capture); |
|
|
|
for (int i = 0; i < device_count; ++i) { |
|
|
|
device_list.emplace_back(SDL_GetAudioDeviceName(i, 0)); |
|
|
|
if (const char* name = SDL_GetAudioDeviceName(i, capture)) { |
|
|
|
device_list.emplace_back(name); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return device_list; |
|
|
|
|