fix testffmpeg.c build.

This commit is contained in:
Ozkan Sezer
2023-10-10 14:02:40 +03:00
parent 303f4e965c
commit 86ada8a9f0

View File

@@ -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;