From 811cd0653f6f48f336563ceeea50a4a9db1775c2 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 17 Oct 2009 13:09:27 +0000 Subject: [PATCH] make sure update_late isn't executed when dt=0 --- simgear/sound/sample_openal.cxx | 3 +++ simgear/sound/soundmgr_openal.cxx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 191877ae..d82c42a2 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -183,4 +183,7 @@ void SGSoundSample::update_absolute_position() { orient = SGQuatd::fromRealImag(0, _relative_pos) * _orientation; _absolute_pos = -SGVec3d::fromGeod(_base_pos) -orient.rotate(SGVec3d::e1()); + + float vel = length(_velocity); + _velocity = toVec3d(_orivec * vel); } diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 10d406e0..1ab11035 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -222,7 +222,7 @@ void SGSoundMgr::unbind () // run the audio scheduler void SGSoundMgr::update_late( double dt ) { - if (_working) { + if (_working && dt != 0.0) { alcSuspendContext(_context); sample_group_map_iterator sample_grp_current = _sample_groups.begin(); -- 2.39.5