comparison src/audio/alsa/SDL_alsa_audio.c @ 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 afadcd7d2319
children 4eb6b4be1dbc
comparison
equal deleted inserted replaced
4335:a1a337237d42 4336:77b20871fd44
315 static void ALSA_PlayAudio(_THIS) 315 static void ALSA_PlayAudio(_THIS)
316 { 316 {
317 int status; 317 int status;
318 snd_pcm_uframes_t frames_left; 318 snd_pcm_uframes_t frames_left;
319 const Uint8 *sample_buf = (const Uint8 *) mixbuf; 319 const Uint8 *sample_buf = (const Uint8 *) mixbuf;
320 const int sample_size = ((int) (this->spec.format & 0xFF)) / 8; 320 const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) * this->spec.channels;
321 321
322 swizzle_alsa_channels(this); 322 swizzle_alsa_channels(this);
323 323
324 frames_left = ((snd_pcm_uframes_t) this->spec.samples); 324 frames_left = ((snd_pcm_uframes_t) this->spec.samples);
325 325
344 this->enabled = 0; 344 this->enabled = 0;
345 return; 345 return;
346 } 346 }
347 continue; 347 continue;
348 } 348 }
349 sample_buf += status * sample_size; 349 sample_buf += status * frame_size;
350 frames_left -= status; 350 frames_left -= status;
351 } 351 }
352 } 352 }
353 353
354 static Uint8 *ALSA_GetAudioBuf(_THIS) 354 static Uint8 *ALSA_GetAudioBuf(_THIS)