summaryrefslogtreecommitdiff
path: root/src/audio_core/audio_manager.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2022-09-21 09:35:20 -0400
committerGravatar Lioncash2022-09-21 09:35:22 -0400
commit75d6fe3669c5fcbb437247c2c115f401ebb5c30e (patch)
tree9acd67a73c0e0e60cfd39d4586aeb6cfb0fb70e0 /src/audio_core/audio_manager.cpp
parentaudio_manager: move std::functions in SetOutManager/SetInManager (diff)
downloadyuzu-75d6fe3669c5fcbb437247c2c115f401ebb5c30e.tar.gz
yuzu-75d6fe3669c5fcbb437247c2c115f401ebb5c30e.tar.xz
yuzu-75d6fe3669c5fcbb437247c2c115f401ebb5c30e.zip
audio_manager: Remove redundant cast in ThreadFunc()
We can just use a local here to get rid of a second cast.
Diffstat (limited to 'src/audio_core/audio_manager.cpp')
-rw-r--r--src/audio_core/audio_manager.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/audio_core/audio_manager.cpp b/src/audio_core/audio_manager.cpp
index d101e6163..e23af0ef5 100644
--- a/src/audio_core/audio_manager.cpp
+++ b/src/audio_core/audio_manager.cpp
@@ -58,19 +58,21 @@ void AudioManager::ThreadFunc() {
58 running = true; 58 running = true;
59 59
60 while (running) { 60 while (running) {
61 auto timed_out{events.Wait(l, std::chrono::seconds(2))}; 61 const auto timed_out{events.Wait(l, std::chrono::seconds(2))};
62 62
63 if (events.CheckAudioEventSet(Event::Type::Max)) { 63 if (events.CheckAudioEventSet(Event::Type::Max)) {
64 break; 64 break;
65 } 65 }
66 66
67 for (size_t i = 0; i < buffer_events.size(); i++) { 67 for (size_t i = 0; i < buffer_events.size(); i++) {
68 if (events.CheckAudioEventSet(Event::Type(i)) || timed_out) { 68 const auto event_type = static_cast<Event::Type>(i);
69
70 if (events.CheckAudioEventSet(event_type) || timed_out) {
69 if (buffer_events[i]) { 71 if (buffer_events[i]) {
70 buffer_events[i](); 72 buffer_events[i]();
71 } 73 }
72 } 74 }
73 events.SetAudioEvent(Event::Type(i), false); 75 events.SetAudioEvent(event_type, false);
74 } 76 }
75 } 77 }
76} 78}