Keep updating the tick time even if the sound manager is null
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@659 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -335,22 +335,24 @@ public class OpenALSoundPlayer extends SoundPlayer
|
|||||||
} else {
|
} else {
|
||||||
r = _queue.get(STREAM_UPDATE_INTERVAL - elapsed);
|
r = _queue.get(STREAM_UPDATE_INTERVAL - elapsed);
|
||||||
}
|
}
|
||||||
|
long newTime;
|
||||||
if (_alSoundManager == null) {
|
if (_alSoundManager == null) {
|
||||||
// We weren't able to initialize the sound system, and we logged it earlier, so
|
// We weren't able to initialize the sound system, and we logged it earlier, so
|
||||||
// just empty the queue and bail without running the code that needs the sound
|
// just empty the queue and update the tick time without running the code that
|
||||||
// manager.
|
// needs the sound manager.
|
||||||
return;
|
newTime = _timer.getElapsedMillis();
|
||||||
}
|
} else {
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
try {
|
try {
|
||||||
r.run();
|
r.run();
|
||||||
|
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.warning("Runnable posted to SoundPlayerQueue barfed.", t);
|
log.warning("Runnable posted to SoundPlayerQueue barfed.", t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
newTime = _timer.getElapsedMillis();
|
||||||
|
_alSoundManager.updateStreams((newTime - _lastTick)/ 1000F);
|
||||||
}
|
}
|
||||||
long newTime = _timer.getElapsedMillis();
|
|
||||||
_alSoundManager.updateStreams((newTime - _lastTick)/ 1000F);
|
|
||||||
_lastTick = newTime;
|
_lastTick = newTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user