浏览代码

don't unhook the stream

it caused a bad connection to take really long to recover from
Gil Pedersen 12 年之前
父节点
当前提交
df7fb1e5ee
共有 1 个文件被更改,包括 1 次插入12 次删除
  1. 1 12
      bin/hlsdump

+ 1 - 12
bin/hlsdump

@@ -123,11 +123,8 @@ function hook(stream) {
     smooth.on('unpipe', function() {
       this.unpipe();
     });
-    smooth.once('error', function(err) {
+    smooth.on('error', function(err) {
       console.error('smooth error', err);
-      unhook(stream);
-
-      smooth.on('error', function () {});
     });
     s = s.pipe(smooth);
   }
@@ -139,13 +136,5 @@ function hook(stream) {
   hooked = true;
 }
 
-function unhook(stream) {
-  if (hooked) {
-    console.error('unhooking output');
-    stream.unpipe();
-    hooked = false;
-  }
-}
-
 if (!hlsdump.sync)
   hook(buffer);