|
@@ -1,8 +1,14 @@
|
|
|
var util = require('util'),
|
|
var util = require('util'),
|
|
|
assert = require('assert');
|
|
assert = require('assert');
|
|
|
|
|
|
|
|
-var async = require('async'),
|
|
|
|
|
- Transform = require('readable-stream/transform');
|
|
|
|
|
|
|
+var async = require('async');
|
|
|
|
|
+
|
|
|
|
|
+try {
|
|
|
|
|
+ var Transform = require('stream').Transform;
|
|
|
|
|
+ assert(Transform);
|
|
|
|
|
+} catch (e) {
|
|
|
|
|
+ var Transform = require('readable-stream/transform');
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// In Transport Streams the intended rate is determined by the values of the PCR fields and the number of Transport Stream bytes between them. (ISO-13818-1 D.0.9)
|
|
// In Transport Streams the intended rate is determined by the values of the PCR fields and the number of Transport Stream bytes between them. (ISO-13818-1 D.0.9)
|
|
|
|
|
|
|
@@ -32,7 +38,6 @@ function parsePCR(buffer, index) {
|
|
|
|
|
|
|
|
function TsSmooth(options) {
|
|
function TsSmooth(options) {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
-// stream.Transform.call(this, {bufferSize:188*7, highWaterMark:64*1024});
|
|
|
|
|
this.options = options || {};
|
|
this.options = options || {};
|
|
|
|
|
|
|
|
// the buffer is only used for partial TS packets ()< 188 bytes)
|
|
// the buffer is only used for partial TS packets ()< 188 bytes)
|
|
@@ -90,11 +95,11 @@ function TsSmooth(options) {
|
|
|
return pcrtime;
|
|
return pcrtime;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- stream.Transform.call(this);
|
|
|
|
|
|
|
+ Transform.call(this);
|
|
|
|
|
|
|
|
return this;
|
|
return this;
|
|
|
}
|
|
}
|
|
|
-util.inherits(TsSmooth, stream.Transform);
|
|
|
|
|
|
|
+util.inherits(TsSmooth, Transform);
|
|
|
|
|
|
|
|
function utime() {
|
|
function utime() {
|
|
|
var t = process.hrtime(); // based on CLOCK_MONOTONIC, and thus accommodates local drift (but apparently not suspend)
|
|
var t = process.hrtime(); // based on CLOCK_MONOTONIC, and thus accommodates local drift (but apparently not suspend)
|