make audio safer

- centralized stop function
- freeing the struct not from the thread while waiting on handle in it
- thread not detached
- maybe fixes hang on exit from HM in ndsp status check loop
This commit is contained in:
LiquidFenrir
2022-06-14 12:54:02 +02:00
parent 9ebfe387a0
commit 4a56a883fa
5 changed files with 26 additions and 30 deletions

View File

@@ -608,7 +608,6 @@ 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
svcCreateEvent(&audio->finished, RESET_STICKY);
ndspChnSetInterp(0, NDSP_INTERP_LINEAR);
ndspChnSetMix(0, audio->mix); // See mix comment above