Sfoglia il codice sorgente

add a safety valve on timeout

Gil Pedersen 13 anni fa
parent
commit
c76d7c2e5b
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      lib/tssmooth.js

+ 1 - 1
lib/tssmooth.js

@@ -120,7 +120,7 @@ function outputBefore(stream, buffer, endTime, packetSize, cb) {
 
     if (index < buffer.length) {
       //debug('packetTime', (packetTime/1000).toFixed(2));
-      return setTimeout(outputPacket, Math.max(0.95*packetTime/1000, 0));
+      return setTimeout(outputPacket, Math.min(Math.max(0.95*packetTime/1000, 0), 50));
     }
     cb();
   }