|
|
@@ -118,11 +118,7 @@ function outputBefore(stream, buffer, endTime, packetSize, cb) {
|
|
|
stream.push(buffer.slice(index, Math.min(buffer.length, index+packetSize)));
|
|
|
index += packetSize;
|
|
|
|
|
|
- if (index < buffer.length) {
|
|
|
- //debug('packetTime', (packetTime/1000).toFixed(2));
|
|
|
- return setTimeout(outputPacket, Math.min(Math.max(0.95*packetTime/1000, 1), 50));
|
|
|
- }
|
|
|
- cb();
|
|
|
+ setTimeout((index < buffer.length) ? outputPacket: cb, Math.min(Math.max(0.95*packetTime/1000, 1), 50));
|
|
|
}
|
|
|
outputPacket();
|
|
|
}
|