Fixed QR code bug
This commit is contained in:
@@ -46,9 +46,11 @@ static u16 * camera_buf = NULL;
|
|||||||
|
|
||||||
void exit_qr(qr_data *data)
|
void exit_qr(qr_data *data)
|
||||||
{
|
{
|
||||||
|
DEBUG("Exiting QR");
|
||||||
svcSignalEvent(data->cancel);
|
svcSignalEvent(data->cancel);
|
||||||
while(!data->finished)
|
while(!data->finished)
|
||||||
svcSleepThread(1000000);
|
svcSleepThread(1000000);
|
||||||
|
svcCloseHandle(data->cancel);
|
||||||
data->capturing = false;
|
data->capturing = false;
|
||||||
|
|
||||||
free(data->camera_buffer);
|
free(data->camera_buffer);
|
||||||
@@ -87,6 +89,7 @@ void capture_cam_thread(void *arg)
|
|||||||
svcWaitSynchronizationN(&index, events, 3, false, U64_MAX);
|
svcWaitSynchronizationN(&index, events, 3, false, U64_MAX);
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case 0:
|
case 0:
|
||||||
|
DEBUG("Cancel event received\n");
|
||||||
cancel = true;
|
cancel = true;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -471,7 +471,8 @@ Result load_audio(Entry_s entry, audio_s *audio)
|
|||||||
}
|
}
|
||||||
|
|
||||||
audio->mix[0] = audio->mix[1] = 1.0f; // Determines volume for the 12 (?) different outputs. See http://smealum.github.io/ctrulib/channel_8h.html#a30eb26f1972cc3ec28370263796c0444
|
audio->mix[0] = audio->mix[1] = 1.0f; // Determines volume for the 12 (?) different outputs. See http://smealum.github.io/ctrulib/channel_8h.html#a30eb26f1972cc3ec28370263796c0444
|
||||||
|
svcCreateEvent(&audio->finished, RESET_STICKY);
|
||||||
|
|
||||||
ndspChnSetInterp(0, NDSP_INTERP_LINEAR);
|
ndspChnSetInterp(0, NDSP_INTERP_LINEAR);
|
||||||
ndspChnSetRate(0, 44100);
|
ndspChnSetRate(0, 44100);
|
||||||
ndspChnSetFormat(0, NDSP_FORMAT_STEREO_PCM16); // Tremor outputs ogg files in 16 bit PCM stereo
|
ndspChnSetFormat(0, NDSP_FORMAT_STEREO_PCM16); // Tremor outputs ogg files in 16 bit PCM stereo
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
// Play a given audio struct
|
// Play a given audio struct
|
||||||
Result update_audio(audio_s *audio)
|
Result update_audio(audio_s *audio)
|
||||||
{
|
{
|
||||||
svcCreateEvent(&audio->finished, RESET_STICKY);
|
|
||||||
|
|
||||||
long size = audio->wave_buf[audio->buf_pos].nsamples * 4 - audio->data_read;
|
long size = audio->wave_buf[audio->buf_pos].nsamples * 4 - audio->data_read;
|
||||||
char size_info[50] = {0};
|
char size_info[50] = {0};
|
||||||
sprintf(size_info, "Audio Size: %ld\n", size);
|
sprintf(size_info, "Audio Size: %ld\n", size);
|
||||||
@@ -78,6 +76,8 @@ void thread_audio(void* data) {
|
|||||||
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);
|
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);
|
||||||
|
svcSleepThread(1e8);
|
||||||
|
svcCloseHandle(audio->finished);
|
||||||
free(audio);
|
free(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user