(NSW) fix switch audio driver to not start the audio output twice and not start it by default

This commit is contained in:
misson20000 2017-12-29 21:02:02 -08:00 committed by twinaphex
parent e9b6f1e18d
commit 5003a2d50b

View File

@ -130,16 +130,23 @@ static bool switch_audio_stop(void *data)
if (!swa)
return false;
if(!swa->is_paused) {
if(audio_ipc_output_stop(&swa->output) != RESULT_OK)
return false;
}
swa->is_paused = true;
return audio_ipc_output_stop(&swa->output) == RESULT_OK;
return true;
}
static bool switch_audio_start(void *data, bool is_shutdown)
{
switch_audio_t *swa = (switch_audio_t*) data;
if (audio_ipc_output_start(&swa->output) != RESULT_OK)
return false;
if(swa->is_paused) {
if (audio_ipc_output_start(&swa->output) != RESULT_OK)
return false;
}
swa->is_paused = false;
return true;
@ -260,9 +267,8 @@ static void *switch_audio_init(const char *device,
swa->latency = latency;
swa->last_append = svcGetSystemTick();
if (audio_ipc_output_start(&swa->output) != RESULT_OK)
goto fail_audio_output;
swa->is_paused = true;
return swa;
fail_audio_output: