|
|
@@ -90,8 +90,9 @@ TsLimit.prototype._transform = function(chunk, output, cb) {
|
|
|
var pcr = parsePCR(buf.slice(i, i+188));
|
|
|
if (pcr !== -1) {
|
|
|
var pcrtime = self.pcr2time(pcr);
|
|
|
- if (Math.abs(pcrtime - self.time) > 100E3) {
|
|
|
- console.error('PCR_error: '+((pcrtime - self.time)/1E6).toFixed(2)+'s missing');
|
|
|
+ var delta = pcrtime - self.time;
|
|
|
+ if (delta > 100E3 || delta < -500E3) {
|
|
|
+ console.error('PCR_error: '+(delta/1E6).toFixed(2)+'s missing');
|
|
|
var elapsed = now - self.time;
|
|
|
if (now < self.time || now > pcrtime) {
|
|
|
console.error('PCR sync reset');
|