diff options
| author | 2022-10-16 20:37:11 -0400 | |
|---|---|---|
| committer | 2022-10-16 21:36:40 -0400 | |
| commit | 4b773b15a6cb7d78d7a9d71cf0f73fb5af591cba (patch) | |
| tree | d28a28a893c7eaf3b7358daaf9af0d08875702c7 /src/audio_core/sink | |
| parent | sdl2_sink: Distinguish between capture and non-capture device names (diff) | |
| download | yuzu-4b773b15a6cb7d78d7a9d71cf0f73fb5af591cba.tar.gz yuzu-4b773b15a6cb7d78d7a9d71cf0f73fb5af591cba.tar.xz yuzu-4b773b15a6cb7d78d7a9d71cf0f73fb5af591cba.zip | |
sdl2_sink: Inline variable init into if condition
Co-authored-by: Mai <mathew1800@gmail.com>
Diffstat (limited to 'src/audio_core/sink')
| -rw-r--r-- | src/audio_core/sink/sdl2_sink.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index cc13c6254..c138dc628 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp | |||
| @@ -230,8 +230,7 @@ std::vector<std::string> ListSDLSinkDevices(bool capture) { | |||
| 230 | 230 | ||
| 231 | const int device_count = SDL_GetNumAudioDevices(capture); | 231 | const int device_count = SDL_GetNumAudioDevices(capture); |
| 232 | for (int i = 0; i < device_count; ++i) { | 232 | for (int i = 0; i < device_count; ++i) { |
| 233 | const char* name = SDL_GetAudioDeviceName(i, capture); | 233 | if (const char* name = SDL_GetAudioDeviceName(i, capture)) { |
| 234 | if (name != nullptr) { | ||
| 235 | device_list.emplace_back(name); | 234 | device_list.emplace_back(name); |
| 236 | } | 235 | } |
| 237 | } | 236 | } |