aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-15 18:19:00 -0700
committerChris Robinson <[email protected]>2009-09-15 18:19:00 -0700
commit6636131d3bb52687229881d4d2343b5c464b5c81 (patch)
tree6a7b093f0a9edf563c3736a7c506a227f723b518 /Alc/alsa.c
parenteeea9631ce15d1bd239a837331658a2fb951f46f (diff)
Pass the frame count to aluMixData
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 9300572e..5d7026e2 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -166,7 +166,6 @@ static ALuint ALSAProc(ALvoid *ptr)
snd_pcm_sframes_t avail, commitres;
snd_pcm_uframes_t offset, frames;
char *WritePtr;
- int WriteCnt;
int err;
while(!data->killNow)
@@ -230,8 +229,7 @@ static ALuint ALSAProc(ALvoid *ptr)
}
WritePtr = (char*)areas->addr + (offset * areas->step / 8);
- WriteCnt = psnd_pcm_frames_to_bytes(data->pcmHandle, frames);
- aluMixData(pDevice->Context, WritePtr, WriteCnt, pDevice->Format);
+ aluMixData(pDevice->Context, WritePtr, frames, pDevice->Format);
commitres = psnd_pcm_mmap_commit(data->pcmHandle, offset, frames);
if (commitres < 0 || (commitres-frames) != 0)
@@ -267,12 +265,12 @@ static ALuint ALSANoMMapProc(ALvoid *ptr)
break;
}
+ avail = data->size / psnd_pcm_frames_to_bytes(data->pcmHandle, 1);
SuspendContext(NULL);
- aluMixData(pDevice->Context, data->buffer, data->size, pDevice->Format);
+ aluMixData(pDevice->Context, data->buffer, avail, pDevice->Format);
ProcessContext(NULL);
WritePtr = data->buffer;
- avail = (snd_pcm_uframes_t)data->size / psnd_pcm_frames_to_bytes(data->pcmHandle, 1);
while(avail > 0)
{
int ret = psnd_pcm_writei(data->pcmHandle, WritePtr, avail);