Well then! That last bit of debugging has finally shown me the light!
Queue.append() only does a notify() if the queue was previously empty. So when the dobj thread was requesting two sounds one after another, it only woke up one player thread, which played the first sound and then came back 'round to play the next sound after it was done. The next sound was usually expired by that time. Use queue.appendLoud(), which always wakes up a waiter thread. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3342 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -281,7 +281,7 @@ public class SoundManager
|
||||
if (key.cmd == PLAY && _queue.size() > MAX_QUEUE_SIZE) {
|
||||
queued = add = false;
|
||||
} else {
|
||||
_queue.append(key);
|
||||
_queue.appendLoud(key);
|
||||
queued = true;
|
||||
add = okToStartNew && (_freeSpoolers == 0) &&
|
||||
(_spoolerCount < MAX_SPOOLERS);
|
||||
|
||||
Reference in New Issue
Block a user