Fix race condition with music not being done playing
This commit is contained in:
@@ -198,6 +198,7 @@ void update_qr(qr_data *data)
|
|||||||
if (!quirc_decode(&code, &scan_data))
|
if (!quirc_decode(&code, &scan_data))
|
||||||
{
|
{
|
||||||
exit_qr(data);
|
exit_qr(data);
|
||||||
|
data->finished_update = true;
|
||||||
|
|
||||||
draw_install(INSTALL_DOWNLOAD);
|
draw_install(INSTALL_DOWNLOAD);
|
||||||
char * zip_buf = NULL;
|
char * zip_buf = NULL;
|
||||||
@@ -276,7 +277,6 @@ void update_qr(qr_data *data)
|
|||||||
|
|
||||||
free(filename);
|
free(filename);
|
||||||
free(zip_buf);
|
free(zip_buf);
|
||||||
data->finished_update = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,4 +298,3 @@ bool init_qr(void)
|
|||||||
|
|
||||||
return (bool)data->success;
|
return (bool)data->success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ void thread_audio(void* data) {
|
|||||||
ov_clear(&audio->vf);
|
ov_clear(&audio->vf);
|
||||||
linearFree(audio->wave_buf[0].data_vaddr);
|
linearFree(audio->wave_buf[0].data_vaddr);
|
||||||
linearFree(audio->wave_buf[1].data_vaddr);
|
linearFree(audio->wave_buf[1].data_vaddr);
|
||||||
|
while (audio->wave_buf[0].status != NDSP_WBUF_DONE || audio->wave_buf[1].status != NDSP_WBUF_DONE) svcSleepThread(1e7);
|
||||||
svcSignalEvent(audio->finished);
|
svcSignalEvent(audio->finished);
|
||||||
free(audio);
|
free(audio);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user