From 77b584d89f7552d70a8efab93e3e477677416464 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 3 May 2023 20:11:18 +0200 Subject: [PATCH] mix init check --- src/audio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio.c b/src/audio.c index 519c0d8..8b745db 100644 --- a/src/audio.c +++ b/src/audio.c @@ -19,7 +19,11 @@ void callback(void *_, Uint8 *stream, int size) { } void initMusic(Mix_Chunk *music, const char *filename) { - Mix_Init(MIX_INIT_MID); + if (!Mix_Init(MIX_INIT_MID)) { + fprintf(stderr, "Erreur Mix_Init\n"); + exit(2); + } + if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 1, 2048)) { fprintf(stderr, "Erreur Mix_OpenAudio\n"); exit(2);