mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 09:35:21 +00:00
Do not start audio driver out of the blue.
This commit is contained in:
parent
a9eaa86683
commit
da941b8c6c
@ -714,19 +714,33 @@ void rarch_exec (void)
|
||||
#ifdef HAVE_RSOUND
|
||||
bool rarch_console_rsound_start(const char *ip)
|
||||
{
|
||||
uninit_audio();
|
||||
strlcpy(g_settings.audio.driver, "rsound", sizeof(g_settings.audio.driver));
|
||||
strlcpy(g_settings.audio.device, ip, sizeof(g_settings.audio.device));
|
||||
driver.audio = &audio_rsound;
|
||||
driver.audio_data = NULL;
|
||||
init_audio();
|
||||
|
||||
// If driver already has started, it must be reinited.
|
||||
if (driver.audio_data)
|
||||
{
|
||||
uninit_audio();
|
||||
driver.audio_data = NULL;
|
||||
init_drivers_pre();
|
||||
init_audio();
|
||||
}
|
||||
return g_extern.audio_active;
|
||||
}
|
||||
|
||||
void rarch_console_rsound_stop(void)
|
||||
{
|
||||
uninit_audio();
|
||||
init_drivers_pre();
|
||||
init_audio();
|
||||
strlcpy(g_settings.audio.driver, config_get_default_audio(), sizeof(g_settings.audio.driver));
|
||||
|
||||
// If driver already has started, it must be reinited.
|
||||
if (driver.audio_data)
|
||||
{
|
||||
uninit_audio();
|
||||
driver.audio_data = NULL;
|
||||
init_drivers_pre();
|
||||
init_audio();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user