shithub: cstory

Download patch

ref: 6cc976d4d625baaf549c28f7a8f205bbd8202fba
parent: 28964f166c3f8c8e118a79a93421cf6af67ff20e
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jul 1 22:31:55 EDT 2020

Wii U audio tweaks

Clean-up better, and neaten-up some code

--- a/src/Backends/Audio/WiiU-Software.cpp
+++ b/src/Backends/Audio/WiiU-Software.cpp
@@ -192,8 +192,7 @@
 
 							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 @@
 
 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);