Fix for 410 sound issue.

This commit is contained in:
andriy921 2016-04-12 01:01:30 +03:00
parent 0499b68ecf
commit 8de7f2c6ec
3 changed files with 27 additions and 0 deletions

View File

@ -72,3 +72,23 @@ void InitAXFunctionPointers(void)
OS_FIND_EXPORT(sound_handle, AXSetVoiceLoopOffset);
}
void ProperlyEndTransitionAudio(void)
{
bool (* check_os_audio_transition_flag_old)(void);
void (* AXInit_old)(void);
void (* AXQuit_old)(void);
unsigned int *funcPointer = 0;
unsigned int sound_handle;
OSDynLoad_Acquire("snd_core.rpl", &sound_handle);
OS_FIND_EXPORT_EX(sound_handle, check_os_audio_transition_flag, check_os_audio_transition_flag_old);
OS_FIND_EXPORT_EX(sound_handle, AXInit, AXInit_old);
OS_FIND_EXPORT_EX(sound_handle, AXQuit, AXQuit_old);
if (check_os_audio_transition_flag_old())
{
AXInit_old();
AXQuit_old();
}
}

View File

@ -31,6 +31,7 @@ extern "C" {
#include <gctypes.h>
void InitAXFunctionPointers(void);
void ProperlyEndTransitionAudio(void);
extern void (* AXInitWithParams)(u32 * params);
extern void (* AXQuit)(void);

View File

@ -216,6 +216,12 @@ SoundDecoder * SoundHandler::GetSoundDecoder(const u8 * sound, int length)
void SoundHandler::executeThread()
{
// v2 sound lib can not properly end transition audio on old firmwares.
if (OS_FIRMWARE <= 410)
{
ProperlyEndTransitionAudio();
}
//! initialize 48 kHz renderer
u32 params[3] = { 1, 0, 0 };
AXInitWithParams(params);