From 86ada8a9f083aa3bbc604664f64de083f78e1a5e Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 10 Oct 2023 14:02:40 +0300
Subject: [PATCH] fix testffmpeg.c build.
---
test/testffmpeg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/testffmpeg.c b/test/testffmpeg.c
index e7cc1b89e434..5ef3bae73e97 100644
--- a/test/testffmpeg.c
+++ b/test/testffmpeg.c
@@ -726,6 +726,7 @@ static SDL_bool IsPlanarAudioFormat(enum AVSampleFormat format)
static void InterleaveAudio(AVFrame *frame, const SDL_AudioSpec *spec)
{
+ int c, n;
int samplesize = SDL_AUDIO_BYTESIZE(spec->format);
int framesize = SDL_AUDIO_FRAMESIZE(*spec);
Uint8 *data = (Uint8 *)SDL_malloc(frame->nb_samples * framesize);
@@ -734,10 +735,10 @@ static void InterleaveAudio(AVFrame *frame, const SDL_AudioSpec *spec)
}
/* This could be optimized with SIMD and not allocating memory each time */
- for (int c = 0; c < spec->channels; ++c) {
+ for (c = 0; c < spec->channels; ++c) {
const Uint8 *src = frame->data[c];
Uint8 *dst = data + c * samplesize;
- for (int n = frame->nb_samples; n--; ) {
+ for (n = frame->nb_samples; n--; ) {
SDL_memcpy(dst, src, samplesize);
src += samplesize;
dst += framesize;