From c9830eac8cbf831deed4138db6e8914335dfdae1 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 8 Jul 2011 01:22:43 +0000 Subject: [PATCH] Worked around a potential linux audio bug: on one machine the sfx manager kept on reporting that it was playing (the track intro sound), while it wasn't. That resulted in STK hanging (not reaching the 'ready set go' phase). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9192 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/modes/world_status.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modes/world_status.cpp b/src/modes/world_status.cpp index b20fc813b..e831fb434 100644 --- a/src/modes/world_status.cpp +++ b/src/modes/world_status.cpp @@ -103,9 +103,6 @@ void WorldStatus::enterRaceOverState() */ void WorldStatus::terminateRace() { -// FIXME JH: this is not necessary anymore, -// since registering the gui with the state manager -// does the same. pause(RESULT_DISPLAY_PHASE); if(network_manager->getMode()==NetworkManager::NW_SERVER) network_manager->sendRaceResults(); } // terminateRace @@ -130,8 +127,17 @@ void WorldStatus::update(const float dt) m_track_intro_sound->play(); return; case TRACK_INTRO_PHASE: - if(m_track_intro_sound->getStatus()==SFXManager::SFX_PLAYING) + m_auxiliary_timer += dt; + // Work around a bug that occurred on linux once: + // the sfx_manager kept on reporting that it is playing, + // while it was not - so STK would never reach the ready + // ... phase. Since the sound effect is about 3 seconds + // long, we use the aux timer to force the next phase + // after 3.5 seconds. + if(m_track_intro_sound->getStatus()==SFXManager::SFX_PLAYING + && m_auxiliary_timer<3.5f) return; + m_auxiliary_timer = 0.0f; m_prestart_sound->play(); m_phase = READY_PHASE; for(unsigned int i=0; igetNumKarts(); i++)