changeset 4336:77b20871fd44 SDL-1.2

Thilo helped me track down the audio issue with 22050 hz stereo sound. Yay!
author Sam Lantinga <slouken@libsdl.org>
date Wed, 14 Oct 2009 07:34:35 +0000
parents a1a337237d42
children 4eb6b4be1dbc
files src/audio/alsa/SDL_alsa_audio.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/audio/alsa/SDL_alsa_audio.c	Tue Oct 13 18:14:13 2009 +0000
+++ b/src/audio/alsa/SDL_alsa_audio.c	Wed Oct 14 07:34:35 2009 +0000
@@ -317,7 +317,7 @@
 	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 @@
 			}
 			continue;
 		}
-		sample_buf += status * sample_size;
+		sample_buf += status * frame_size;
 		frames_left -= status;
 	}
 }