1
0
Fork 0

Erik Hofman:

This is a small patch which resets the delay counter if the sound
doesn't need to be stopped. Also the code is reorganiozed a bit to fix
sume "bugs".
This commit is contained in:
curt 2002-09-30 18:45:09 +00:00
parent b0afca93d5
commit 1604c9bae2

View file

@ -270,22 +270,22 @@ FGSound::update (double dt)
) )
{ {
if (_sample->is_playing()) { if ((_mode != FGSound::IN_TRANSIT) || (_stopping < MAX_TRANSIT_TIME)) {
if ((_mode != FGSound::IN_TRANSIT) || (_stopping < MAX_TRANSIT_TIME)) {
_active = false;
_sample->stop( _mgr->get_scheduler() );
if (_sample->is_playing()) {
SG_LOG(SG_GENERAL, SG_INFO, "Stopping audio after " << _dt_play SG_LOG(SG_GENERAL, SG_INFO, "Stopping audio after " << _dt_play
<< " sec: " << _name ); << " sec: " << _name );
} else _sample->stop( _mgr->get_scheduler() );
_stopping += dt; }
}
_dt_stop += dt; _active = false;
_dt_play = 0.0; _dt_stop += dt;
_dt_play = 0.0;
} else
_stopping += dt;
return; return;
@ -308,10 +308,12 @@ FGSound::update (double dt)
} }
// //
// Update playing time and cache the current value. // Update the playing time, cache the current value and
// clear the delay timer.
// //
_dt_play += dt; _dt_play += dt;
_prev_value = curr_value; _prev_value = curr_value;
_stopping = 0.0;
// //
// Update the volume // Update the volume