From ad9c702f6ac5e83a6d0286a93c31b55087e6d79b Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 13 Feb 2017 16:56:41 -0500 Subject: [PATCH] audio: SDL_AudioStream's *_sample_frame_size should be in bytes, not bits. Fixes failures where SDL_AudioStreamGet() incorrectly thinks it got a partial sample frame request. --- 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 02b0559358413..691fb39f9530a 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1087,11 +1087,11 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format, the resampled data (!!! FIXME: decide if that works in practice, though!). */ pre_resample_channels = SDL_min(src_channels, dst_channels); - retval->src_sample_frame_size = SDL_AUDIO_BITSIZE(src_format) * src_channels; + retval->src_sample_frame_size = (SDL_AUDIO_BITSIZE(src_format) / 8) * src_channels; retval->src_format = src_format; retval->src_channels = src_channels; retval->src_rate = src_rate; - retval->dst_sample_frame_size = SDL_AUDIO_BITSIZE(dst_format) * dst_channels; + retval->dst_sample_frame_size = (SDL_AUDIO_BITSIZE(dst_format) / 8) * dst_channels; retval->dst_format = dst_format; retval->dst_channels = dst_channels; retval->dst_rate = dst_rate;