From 024d211eb54ecbc2420288a3844cd8b4f8c0fa2c Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 29 Jul 2025 18:36:59 -0400
Subject: [PATCH] testaudiodecoder: Opens an SDL audio device directly, must
call SDL_Init().
Fixes #712.
---
test/testaudiodecoder.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/testaudiodecoder.c b/test/testaudiodecoder.c
index c0b3cc4d..c779442e 100644
--- a/test/testaudiodecoder.c
+++ b/test/testaudiodecoder.c
@@ -37,6 +37,9 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
if (argc != 2) {
SDL_Log("USAGE: %s <file_to_play>", argv[0]);
return SDL_APP_FAILURE;
+ } else if (!SDL_Init(SDL_INIT_AUDIO)) {
+ SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
+ return SDL_APP_FAILURE;
} else if (!MIX_Init()) {
SDL_Log("Couldn't initialize SDL_mixer: %s", SDL_GetError());
return SDL_APP_FAILURE;