mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
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.
This commit is contained in:
parent
175f1e8f4a
commit
ad9c702f6a
@ -1087,11 +1087,11 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format,
|
|||||||
the resampled data (!!! FIXME: decide if that works in practice, though!). */
|
the resampled data (!!! FIXME: decide if that works in practice, though!). */
|
||||||
pre_resample_channels = SDL_min(src_channels, dst_channels);
|
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_format = src_format;
|
||||||
retval->src_channels = src_channels;
|
retval->src_channels = src_channels;
|
||||||
retval->src_rate = src_rate;
|
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_format = dst_format;
|
||||||
retval->dst_channels = dst_channels;
|
retval->dst_channels = dst_channels;
|
||||||
retval->dst_rate = dst_rate;
|
retval->dst_rate = dst_rate;
|
||||||
|
Loading…
Reference in New Issue
Block a user