Do not start audio driver out of the blue.

This commit is contained in:
Themaister 2012-05-07 23:57:39 +02:00
parent a9eaa86683
commit da941b8c6c

View File

@ -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