From 46e244ce4a481cebf11faadfdfe941b55a6f1ce7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Oct 2009 07:34:35 +0000 Subject: [PATCH] Thilo helped me track down the audio issue with 22050 hz stereo sound. Yay! --- src/audio/alsa/SDL_alsa_audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index b04075e91..c14575c89 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -317,7 +317,7 @@ static void ALSA_PlayAudio(_THIS) int status; snd_pcm_uframes_t frames_left; const Uint8 *sample_buf = (const Uint8 *) mixbuf; - const int sample_size = ((int) (this->spec.format & 0xFF)) / 8; + const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) * this->spec.channels; swizzle_alsa_channels(this); @@ -346,7 +346,7 @@ static void ALSA_PlayAudio(_THIS) } continue; } - sample_buf += status * sample_size; + sample_buf += status * frame_size; frames_left -= status; } }