From 9f037e89802a7b4fc6c287bab97b85050bbd6721 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 15 Sep 2009 19:30:27 -0700 Subject: Pass the device to aluMixData --- Alc/alsa.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Alc/alsa.c') 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); -- cgit v1.2.3