From 6cc976d4d625baaf549c28f7a8f205bbd8202fba Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 2 Jul 2020 02:31:55 +0100 Subject: [PATCH] Wii U audio tweaks Clean-up better, and neaten-up some code --- src/Backends/Audio/WiiU-Software.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Backends/Audio/WiiU-Software.cpp b/src/Backends/Audio/WiiU-Software.cpp index fa973492..fe6e7915 100644 --- a/src/Backends/Audio/WiiU-Software.cpp +++ b/src/Backends/Audio/WiiU-Software.cpp @@ -192,8 +192,7 @@ bool AudioBackend_Init(void) AXVoiceDeviceMixData mix_data[6]; memset(mix_data, 0, sizeof(mix_data)); - mix_data[0].bus[0].volume = i == 0 ? 0x8000 : 0; // Channel 1 goes on the left speaker - mix_data[1].bus[0].volume = i == 1 ? 0x8000 : 0; // Channel 2 goes on the right speaker + mix_data[i].bus[0].volume = 0x8000; // Voice 1 goes on the left speaker - voice 2 goes on the right speaker AXSetVoiceDeviceMix(voices[i], AX_DEVICE_TYPE_DRC, 0, mix_data); AXSetVoiceDeviceMix(voices[i], AX_DEVICE_TYPE_TV, 0, mix_data); @@ -243,11 +242,13 @@ bool AudioBackend_Init(void) void AudioBackend_Deinit(void) { - for (unsigned int i = 0; i < 2; ++i) - { - AXFreeVoice(voices[i]); - free(stream_buffers[i]); - } + AXRegisterAppFrameCallback(NULL); + + AXFreeVoice(voices[1]); + AXFreeVoice(voices[0]); + + free(stream_buffers[1]); + free(stream_buffers[0]); free(stream_buffer_long);