Log a more informative message when we catch an exception.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2059 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SoundManager.java,v 1.40 2002/12/10 21:36:33 mdb Exp $
|
// $Id: SoundManager.java,v 1.41 2002/12/12 19:00:25 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.media;
|
package com.threerings.media;
|
||||||
|
|
||||||
@@ -103,24 +103,23 @@ public class SoundManager
|
|||||||
MusicInfo musicInfo = null;
|
MusicInfo musicInfo = null;
|
||||||
|
|
||||||
while (amRunning()) {
|
while (amRunning()) {
|
||||||
try {
|
// Get the next command and arguments
|
||||||
|
synchronized (_queue) {
|
||||||
|
command = _queue.get();
|
||||||
|
|
||||||
// Get the next command and arguments
|
// some commands have an additional argument.
|
||||||
synchronized (_queue) {
|
if ((PLAY == command) ||
|
||||||
command = _queue.get();
|
(STOPMUSIC == command) ||
|
||||||
|
(LOCK == command) ||
|
||||||
|
(UNLOCK == command)) {
|
||||||
|
key = (SoundKey) _queue.get();
|
||||||
|
|
||||||
// some commands have an additional argument.
|
} else if (PLAYMUSIC == command) {
|
||||||
if ((PLAY == command) ||
|
musicInfo = (MusicInfo) _queue.get();
|
||||||
(STOPMUSIC == command) ||
|
|
||||||
(LOCK == command) ||
|
|
||||||
(UNLOCK == command)) {
|
|
||||||
key = (SoundKey) _queue.get();
|
|
||||||
|
|
||||||
} else if (PLAYMUSIC == command) {
|
|
||||||
musicInfo = (MusicInfo) _queue.get();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// execute the command outside of the queue synch
|
// execute the command outside of the queue synch
|
||||||
if (PLAY == command) {
|
if (PLAY == command) {
|
||||||
playSound(key);
|
playSound(key);
|
||||||
@@ -152,7 +151,9 @@ public class SoundManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Captured exception in SoundManager loop.");
|
Log.warning("SoundManager failure [cmd=" + command +
|
||||||
|
", key=" + key +
|
||||||
|
", info=" + musicInfo + "].");
|
||||||
Log.logStackTrace(e);
|
Log.logStackTrace(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user