From c7ed354ee01467bf17ab168fbe0593afbe21a40f Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 2 Jun 2026 14:16:15 -0400
Subject: [PATCH] testaudiodecoder: Remove duplicate exit condition.
We check if `additional_amount` is greater-than zero to decide to stop, so
there's no need to exit early if it's zero on entry.
(cherry picked from commit 23f2454d7ff43359ac02700e4f01566177ad90e3)
---
test/testaudiodecoder.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/test/testaudiodecoder.c b/test/testaudiodecoder.c
index e5a2f70a..fc81e79e 100644
--- a/test/testaudiodecoder.c
+++ b/test/testaudiodecoder.c
@@ -30,11 +30,8 @@ static SDL_AudioSpec spec;
static void SDLCALL AudioDeviceCallback(void *userdata, SDL_AudioStream *stream, int additional_amount, int total_amount)
{
MIX_AudioDecoder *audiodecoder = (MIX_AudioDecoder *) userdata;
- if (!additional_amount) {
- return;
- }
-
Uint8 buffer[1024];
+
while (additional_amount > 0) {
const int needed = SDL_min((int)sizeof(buffer), additional_amount);
const int br = MIX_DecodeAudio(audiodecoder, buffer, needed, &spec);