From 6c8e3e303d15b59df4c592244a7650021b4e8bbb Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 8 Feb 2010 14:43:44 +0000 Subject: 2.5 Audio: - Python script to crossfade two sound strips in the sequencer - Fix for the libsamplerate code producing awful audio when resampling sequencer strips - Changed default resampler to a linear one (as temporary workaround for a bug that seems to be in the samplerate code) - Fix for the OpenAL device to return a more accurate playback position --- intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'intern/audaspace/OpenAL') diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index 9e153b9b34f..7ee8652f226 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -890,11 +890,14 @@ float AUD_OpenALDevice::getPosition(AUD_Handle* handle) if(isValid(handle)) { AUD_OpenALHandle* h = (AUD_OpenALHandle*)handle; - if(h->isBuffered) - alGetSourcef(h->source, AL_SEC_OFFSET, &position); - else - position = h->reader->getPosition() / - (float)h->reader->getSpecs().rate; + alGetSourcef(h->source, AL_SEC_OFFSET, &position); + if(!h->isBuffered) + { + AUD_Specs specs = h->reader->getSpecs(); + position += (h->reader->getPosition() - m_buffersize * + AUD_OPENAL_CYCLE_BUFFERS / specs.channels) / + (float)specs.rate; + } } unlock(); -- cgit v1.2.3