check_mute - go through rarch_main_command instead of directly

calling driver.audio
This commit is contained in:
twinaphex 2014-10-05 20:19:12 +02:00
parent 6086b411cb
commit 34f3c7d22e
2 changed files with 3 additions and 5 deletions

View File

@ -2283,9 +2283,7 @@ bool rarch_main_command(unsigned cmd)
driver.audio->stop(driver.audio_data);
break;
case RARCH_CMD_AUDIO_START:
if (!driver.audio_data)
return false;
if (driver.audio->alive(driver.audio_data))
if (!driver.audio_data || driver.audio->alive(driver.audio_data))
return false;
if (!g_extern.audio_data.mute

View File

@ -38,8 +38,8 @@ static void check_mute(void)
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
if (g_extern.audio_data.mute)
driver.audio->stop(driver.audio_data);
else if (!driver.audio->start(driver.audio_data))
rarch_main_command(RARCH_CMD_AUDIO_STOP);
else if (!rarch_main_command(RARCH_CMD_AUDIO_START))
{
RARCH_ERR("Failed to unmute audio.\n");
driver.audio_active = false;