Simplifications

This commit is contained in:
twinaphex 2017-04-18 03:52:01 +02:00
parent 662755c899
commit 55dd4ac754
2 changed files with 14 additions and 10 deletions

View File

@ -978,12 +978,21 @@ bool audio_driver_start(bool is_shutdown)
settings_t *settings = config_get_ptr();
if (!current_audio || !current_audio->start
|| !audio_driver_context_audio_data)
return false;
goto error;
if (audio_driver_alive())
return false;
goto error;
if (!settings || settings->audio.mute_enable)
return false;
return current_audio->start(audio_driver_context_audio_data, is_shutdown);
goto error;
if (!current_audio->start(audio_driver_context_audio_data, is_shutdown))
goto error;
return true;
error:
RARCH_ERR("%s\n",
msg_hash_to_str(MSG_FAILED_TO_START_AUDIO_DRIVER));
audio_driver_unset_active();
return false;
}
bool audio_driver_alive(void)

View File

@ -2080,12 +2080,7 @@ bool command_event(enum event_command cmd, void *data)
return false;
break;
case CMD_EVENT_AUDIO_START:
if (!audio_driver_start(runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL)))
{
RARCH_ERR("%s\n",
msg_hash_to_str(MSG_FAILED_TO_START_AUDIO_DRIVER));
audio_driver_unset_active();
}
audio_driver_start(runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL));
break;
case CMD_EVENT_AUDIO_MUTE_TOGGLE:
{