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

@@ -46,9 +46,10 @@ typedef struct {
u32 filesize;
volatile bool stop;
Handle finished;
Thread playing_thread;
} audio_s;
void play_audio(audio_s *);
void stop_audio(audio_s**);
#endif