From c58b207419509937104a59443889c049eef02e2d Mon Sep 17 00:00:00 2001 From: saxon Date: Sun, 17 Feb 2019 13:35:55 +1030 Subject: [PATCH] stream: reverted timing changes from most recent PR --- stream/mts/encoder.go | 4 +--- stream/rtp/encoder.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index e63c15bc..6ac11cc3 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -248,9 +248,7 @@ func (e *Encoder) writePSI() error { // tick advances the clock one frame interval. func (e *Encoder) tick() { - now := time.Now() - e.clock += now.Sub(e.lastTime) - e.lastTime = now + e.clock += e.frameInterval } // pts retuns the current presentation timestamp. diff --git a/stream/rtp/encoder.go b/stream/rtp/encoder.go index 28119b43..26016a23 100644 --- a/stream/rtp/encoder.go +++ b/stream/rtp/encoder.go @@ -121,9 +121,7 @@ func (e *Encoder) Encode(payload []byte) error { // tick advances the clock one frame interval. func (e *Encoder) tick() { - now := time.Now() - e.clock += now.Sub(e.lastTime) - e.lastTime = now + e.clock += e.frameInterval } // nxtTimestamp gets the next timestamp