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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-02-08 01:29:31 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-02-08 01:29:31 +0400
commitfaaee15407767812d0fc40adb5256e9d2919c35d (patch)
tree5a99439c8fb4fe52823b7f0e560728ffbbe3342f /source/gameengine/Ketsji/KX_SoundActuator.cpp
parent7cb62127b36d82182642043c57ced97d7f804a69 (diff)
Fix part of #34083: crash trying to play surround .wav file in the game engine
on Windows, it still doesn't play but it doesn't crash at least.
Diffstat (limited to 'source/gameengine/Ketsji/KX_SoundActuator.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 2a4f2b3e7d9..5438ae5a97c 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -132,10 +132,13 @@ void KX_SoundActuator::play()
handle3d->setConeVolumeOuter(m_3d.cone_outer_gain);
}
- if (loop)
- m_handle->setLoopCount(-1);
- m_handle->setPitch(m_pitch);
- m_handle->setVolume(m_volume);
+ if (m_handle.get()) {
+ if (loop)
+ m_handle->setLoopCount(-1);
+ m_handle->setPitch(m_pitch);
+ m_handle->setVolume(m_volume);
+ }
+
m_isplaying = true;
}