Added additional verbose logging to figure out why some clips take
so long to get played. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3338 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -299,6 +299,9 @@ public class SoundManager
|
|||||||
};
|
};
|
||||||
spooler.setDaemon(true);
|
spooler.setDaemon(true);
|
||||||
spooler.start();
|
spooler.start();
|
||||||
|
if (_verbose.getValue()) {
|
||||||
|
Log.info("Started new player thread.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return queued;
|
return queued;
|
||||||
@@ -487,6 +490,7 @@ public class SoundManager
|
|||||||
throws IOException, UnsupportedAudioFileException
|
throws IOException, UnsupportedAudioFileException
|
||||||
{
|
{
|
||||||
byte[][] data;
|
byte[][] data;
|
||||||
|
boolean verbose = _verbose.getValue();
|
||||||
synchronized (_clipCache) {
|
synchronized (_clipCache) {
|
||||||
// if we're testing, clear all non-locked sounds every time
|
// if we're testing, clear all non-locked sounds every time
|
||||||
if (isTesting()) {
|
if (isTesting()) {
|
||||||
@@ -494,12 +498,18 @@ public class SoundManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = (byte[][]) _clipCache.get(key);
|
data = (byte[][]) _clipCache.get(key);
|
||||||
|
if (verbose && data != null) {
|
||||||
|
Log.info("clip loaded from cache [" + key + "].");
|
||||||
|
}
|
||||||
|
|
||||||
// see if it's in the locked cache (we first look in the regular
|
// see if it's in the locked cache (we first look in the regular
|
||||||
// clip cache so that locked clips that are still cached continue
|
// clip cache so that locked clips that are still cached continue
|
||||||
// to be moved to the head of the LRU queue)
|
// to be moved to the head of the LRU queue)
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
data = (byte[][]) _lockedClips.get(key);
|
data = (byte[][]) _lockedClips.get(key);
|
||||||
|
if (verbose && data != null) {
|
||||||
|
Log.info("clip loaded from lock [" + key + "].");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
@@ -523,6 +533,9 @@ public class SoundManager
|
|||||||
for (int ii=0; ii < names.length; ii++) {
|
for (int ii=0; ii < names.length; ii++) {
|
||||||
data[ii] = loadClipData(bundle, names[ii]);
|
data[ii] = loadClipData(bundle, names[ii]);
|
||||||
}
|
}
|
||||||
|
if (verbose) {
|
||||||
|
Log.info("clip loaded from rscmgr [" + key + "].");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_clipCache.put(key, data);
|
_clipCache.put(key, data);
|
||||||
|
|||||||
Reference in New Issue
Block a user