From 4b038fb8e17a9c1232f9c2801f3326d2c62b001b Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Tue, 23 Sep 2008 20:09:36 +0000 Subject: [PATCH] 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 --- .../threerings/openal/OpenALSoundPlayer.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/java/com/threerings/openal/OpenALSoundPlayer.java b/src/java/com/threerings/openal/OpenALSoundPlayer.java index 162ccf4c..e2ef5e9c 100644 --- a/src/java/com/threerings/openal/OpenALSoundPlayer.java +++ b/src/java/com/threerings/openal/OpenALSoundPlayer.java @@ -335,22 +335,24 @@ public class OpenALSoundPlayer extends SoundPlayer } else { r = _queue.get(STREAM_UPDATE_INTERVAL - elapsed); } + long newTime; if (_alSoundManager == null) { // 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 - // manager. - return; - } - if (r != null) { - try { - r.run(); + // just empty the queue and update the tick time without running the code that + // needs the sound manager. + newTime = _timer.getElapsedMillis(); + } else { + if (r != null) { + try { + r.run(); - } catch (Throwable t) { - log.warning("Runnable posted to SoundPlayerQueue barfed.", t); + } catch (Throwable 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; }