mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-04 18:47:09 +00:00
Simplifications
This commit is contained in:
parent
662755c899
commit
55dd4ac754
@ -978,12 +978,21 @@ bool audio_driver_start(bool is_shutdown)
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
if (!current_audio || !current_audio->start
|
if (!current_audio || !current_audio->start
|
||||||
|| !audio_driver_context_audio_data)
|
|| !audio_driver_context_audio_data)
|
||||||
return false;
|
goto error;
|
||||||
if (audio_driver_alive())
|
if (audio_driver_alive())
|
||||||
return false;
|
goto error;
|
||||||
if (!settings || settings->audio.mute_enable)
|
if (!settings || settings->audio.mute_enable)
|
||||||
return false;
|
goto error;
|
||||||
return current_audio->start(audio_driver_context_audio_data, is_shutdown);
|
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)
|
bool audio_driver_alive(void)
|
||||||
|
@ -2080,12 +2080,7 @@ bool command_event(enum event_command cmd, void *data)
|
|||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_AUDIO_START:
|
case CMD_EVENT_AUDIO_START:
|
||||||
if (!audio_driver_start(runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL)))
|
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();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_AUDIO_MUTE_TOGGLE:
|
case CMD_EVENT_AUDIO_MUTE_TOGGLE:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user