Gil Pedersen hace 13 años
padre
commit
f43dd5eea4
Se han modificado 3 ficheros con 7 adiciones y 6 borrados
  1. 1 1
      lib/m3u8.js
  2. 4 3
      lib/reader.js
  3. 2 2
      lib/tssmooth.js

+ 1 - 1
lib/m3u8.js

@@ -277,7 +277,7 @@ function ParserError(msg, line, line_no, constr) {
   Error.captureStackTrace(this, constr || this);
   this.message = msg || 'Error';
   this.line = line;
-  this.line_no = line_no;
+  this.lineNumber = line_no;
 }
 util.inherits(ParserError, Error);
 ParserError.prototype.name = 'Parser Error';

+ 4 - 3
lib/reader.js

@@ -118,7 +118,8 @@ function HlsStreamReader(src, options) {
   this.index = null;
   this.readState = {
     nextSeq:-1,
-    currentSegment:null,
+    active:false,
+    fetching:null
   }
 
   function getUpdateInterval(updated) {
@@ -140,7 +141,7 @@ function HlsStreamReader(src, options) {
       self.emit('index', self.index);
 
       if (self.index.variant)
-        return self.end();
+        return self.push(null);
     }
     checknext(self);
 
@@ -182,7 +183,7 @@ function HlsStreamReader(src, options) {
   }
   updateindex();
 
-  Readable.call(this, extend(options, {objectMode:true}));
+  Readable.call(this, extend(options, {objectMode:true, highWaterMark:options.highWaterMark || 0}));
 }
 util.inherits(HlsStreamReader, Readable);
 

+ 2 - 2
lib/tssmooth.js

@@ -120,11 +120,11 @@ function outputBefore(stream, buffer, endTime, packetSize, cb) {
 
     if (index < buffer.length) {
       //debug('packetTime', (packetTime/1000).toFixed(2));
-      return setTimeout(outputPacket, Math.min(Math.max(0.95*packetTime/1000, 0), 50));
+      return setTimeout(outputPacket, Math.min(Math.max(0.95*packetTime/1000, 1), 50));
     }
     cb();
   }
-  process.nextTick(outputPacket);
+  outputPacket();
 }
 
 TsSmooth.prototype._transform = function(chunk, encoding, cb) {