diff options
author | Joerg Mueller <nexyon@gmail.com> | 2010-02-08 17:43:44 +0300 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2010-02-08 17:43:44 +0300 |
commit | 6c8e3e303d15b59df4c592244a7650021b4e8bbb (patch) | |
tree | dc4d0693751795b506b7c4b3fea39875628b8e76 /intern/audaspace/OpenAL | |
parent | 03bdfb6f312a0259a4bf3e560bff12fb50975a55 (diff) |
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
Diffstat (limited to 'intern/audaspace/OpenAL')
-rw-r--r-- | intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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(); |