X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfsound%2Falsa.c;h=c67943a03f6007c08535205433ffe333a9db3709;hp=2eba878a2f6afebe505fb94da83f6bc57d4ec57d;hb=f8edb5bc279ba09aa7bc762da51236fd368827b0;hpb=ef79bbde537d6b9c745a7d86cb9df1d04c35590d diff --git a/plugins/dfsound/alsa.c b/plugins/dfsound/alsa.c index 2eba878a..c67943a0 100644 --- a/plugins/dfsound/alsa.c +++ b/plugins/dfsound/alsa.c @@ -40,8 +40,7 @@ void SetupSound(void) unsigned int period_time = buffer_time / 4; int err; - if (iDisStereo) pchannels = 1; - else pchannels=2; + pchannels=2; pspeed = 44100; format = SND_PCM_FORMAT_S16; @@ -136,11 +135,11 @@ unsigned long SoundGetBytesBuffered(void) unsigned long l; if (handle == NULL) // failed to open? - return SOUNDSIZE; + return 1; l = snd_pcm_avail(handle); if (l < 0) return 0; if (l < buffer_size / 2) // can we write in at least the half of fragments? - l = SOUNDSIZE; // -> no? wait + l = 1; // -> no? wait else l = 0; // -> else go on return l; @@ -153,6 +152,5 @@ void SoundFeedStreamData(unsigned char* pSound,long lBytes) if (snd_pcm_state(handle) == SND_PCM_STATE_XRUN) snd_pcm_prepare(handle); - snd_pcm_writei(handle,pSound, - iDisStereo ? lBytes / 2 : lBytes / 4); + snd_pcm_writei(handle,pSound, lBytes / 4); }