From 86b5f40b535dffc124e00669a2f7a243bec89d87 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Tue, 2 May 2023 12:29:32 +0100 Subject: [PATCH] Fixed CalculateAudioStreamWorkBufSize --- src/audio/SDL_audiocvt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index ac77896f1..035c07462 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -774,11 +774,11 @@ static Uint8 *EnsureStreamWorkBufferSize(SDL_AudioStream *stream, size_t newlen) static int CalculateAudioStreamWorkBufSize(const SDL_AudioStream *stream, int len) { - int workbuf_frames = len / stream->src_sample_frame_size; /* start with requested sample frames */ + int workbuf_frames = len / stream->dst_sample_frame_size; /* start with requested sample frames */ int workbuflen = len; int inputlen; - inputlen = workbuf_frames * stream->dst_sample_frame_size; + inputlen = workbuf_frames * stream->src_sample_frame_size; if (inputlen > workbuflen) { workbuflen = inputlen; }