From 6dd5f0f6d5130961c2a95938b2190dca9483a066 Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 22 Jun 2007 16:51:12 +0000 Subject: [PATCH] Maik JUSTUS: prevent occasional OpenAL crashes after resets --- src/Main/main.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 3ffc66fff..18e5e025c 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -549,7 +549,7 @@ static void fgMainLoop( void ) { // aircraft is the source of all sounds and that all sounds are // positioned in the aircraft base - static sgVec3 last_pos_offset; + static sgVec3 last_pos_offset = {0, 0, 0}; //get the orientation const SGQuatd view_or = current_view->getViewOrientation(); @@ -601,7 +601,8 @@ static void fgMainLoop( void ) { // set the velocity sgVec3 source_vel; sgSubVec3( source_vel, source_pos_offset, last_pos_offset ); - sgScaleVec3( source_vel, 1 / delta_time_sec ); + if (delta_time_sec > 0) + sgScaleVec3( source_vel, 1 / delta_time_sec ); sgCopyVec3( last_pos_offset, source_pos_offset ); // cout << "vel = " << source_vel[0] << " " << source_vel[1] << " " << source_vel[2] << endl; globals->get_soundmgr()->set_source_vel_all( source_vel ); -- 2.39.5