aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-15 19:30:27 -0700
committerChris Robinson <[email protected]>2009-09-15 19:30:27 -0700
commit9f037e89802a7b4fc6c287bab97b85050bbd6721 (patch)
tree8aafaa57a698d0fdcb799766d786cc44625e22ba /Alc/alsa.c
parent12f81bcbb91f95df8bafdafa29f30adf55701203 (diff)
Pass the device to aluMixData
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 5d7026e2..aad0835a 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -217,29 +217,25 @@ static ALuint ALSAProc(ALvoid *ptr)
{
frames = avail;
- SuspendContext(NULL);
err = psnd_pcm_mmap_begin(data->pcmHandle, &areas, &offset, &frames);
if (err < 0)
{
err = xrun_recovery(data->pcmHandle, err);
if (err < 0)
AL_PRINT("mmap begin error: %s\n", psnd_strerror(err));
- ProcessContext(NULL);
break;
}
WritePtr = (char*)areas->addr + (offset * areas->step / 8);
- aluMixData(pDevice->Context, WritePtr, frames, pDevice->Format);
+ aluMixData(pDevice, WritePtr, frames);
commitres = psnd_pcm_mmap_commit(data->pcmHandle, offset, frames);
if (commitres < 0 || (commitres-frames) != 0)
{
AL_PRINT("mmap commit error: %s\n",
psnd_strerror(commitres >= 0 ? -EPIPE : commitres));
- ProcessContext(NULL);
break;
}
- ProcessContext(NULL);
avail -= frames;
}
@@ -265,12 +261,10 @@ static ALuint ALSANoMMapProc(ALvoid *ptr)
break;
}
+ WritePtr = data->buffer;
avail = data->size / psnd_pcm_frames_to_bytes(data->pcmHandle, 1);
- SuspendContext(NULL);
- aluMixData(pDevice->Context, data->buffer, avail, pDevice->Format);
- ProcessContext(NULL);
+ aluMixData(pDevice, WritePtr, avail);
- WritePtr = data->buffer;
while(avail > 0)
{
int ret = psnd_pcm_writei(data->pcmHandle, WritePtr, avail);