Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2011-02-03 16:25:05 +0300
committerJoerg Mueller <nexyon@gmail.com>2011-02-03 16:25:05 +0300
commit376e0ae2a38f50b5d3479b8b2c2e57e2a7d452be (patch)
tree90db964cee8c0c71bcfcba374d705cf5b1436ccd /intern
parent1e3ec65edcc5b04307f2923d6496524ce9302a62 (diff)
Audio Bugfixes:
* [#25638] 'Insufficient thread locking' for sounds - Actually a workaround for an msvc bug, msvc STL containers are buggy * [#25922] Sound does not play in BlenderPlayer(r34579) - Windows OpenAL doesn't seem to have clear context error state on initialising
Diffstat (limited to 'intern')
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
index 5df7ec4fb0c..6a9f2c40d92 100644
--- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
+++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
@@ -129,6 +129,9 @@ void AUD_OpenALDevice::updateStreams()
ALint info;
AUD_DeviceSpecs specs = m_specs;
ALCenum cerr;
+ std::list<AUD_OpenALHandle*> stopSounds;
+ std::list<AUD_OpenALHandle*> pauseSounds;
+ AUD_HandleIterator it;
while(1)
{
@@ -139,7 +142,7 @@ void AUD_OpenALDevice::updateStreams()
if(cerr == ALC_NO_ERROR)
{
// for all sounds
- for(AUD_HandleIterator it = m_playingSounds->begin(); it != m_playingSounds->end(); it++)
+ for(it = m_playingSounds->begin(); it != m_playingSounds->end(); it++)
{
sound = *it;
@@ -234,21 +237,12 @@ void AUD_OpenALDevice::updateStreams()
if(sound->stop)
sound->stop(sound->stop_data);
- // increment the iterator to the next value,
- // because the sound gets deleted in the list here.
- ++it;
// pause or
if(sound->keep)
- pause(sound);
+ pauseSounds.push_back(sound);
// stop
else
- stop(sound);
- // decrement again, so that we get the next sound in the
- // next loop run
- if(m_playingSounds->empty())
- break;
- else
- --it;
+ stopSounds.push_back(sound);
}
// continue playing
else
@@ -256,6 +250,15 @@ void AUD_OpenALDevice::updateStreams()
}
}
+ for(it = pauseSounds.begin(); it != pauseSounds.end(); it++)
+ pause(*it);
+
+ for(it = stopSounds.begin(); it != stopSounds.end(); it++)
+ stop(*it);
+
+ pauseSounds.clear();
+ stopSounds.clear();
+
alcProcessContext(m_context);
}
@@ -340,6 +343,7 @@ AUD_OpenALDevice::AUD_OpenALDevice(AUD_DeviceSpecs specs, int buffersize)
m_useMC = alIsExtensionPresent("AL_EXT_MCFORMATS") == AL_TRUE;
alGetError();
+ alcGetError(m_device);
m_specs = specs;
m_buffersize = buffersize;