Explorar el Código

add a safety valve on timeout

Gil Pedersen hace 13 años
padre
commit
c76d7c2e5b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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();
   }