Skip to content

Commit

Permalink
audio: SDL_AudioStream's *_sample_frame_size should be in bytes, not …
Browse files Browse the repository at this point in the history
…bits.

Fixes failures where SDL_AudioStreamGet() incorrectly thinks it got a partial
sample frame request.
  • Loading branch information
icculus committed Feb 13, 2017
1 parent 175f1e8 commit ad9c702
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/audio/SDL_audiocvt.c
Expand Up @@ -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;
Expand Down

0 comments on commit ad9c702

Please sign in to comment.