From afc7c1f086002bc9a6c0775ec4d48ab69237045d Mon Sep 17 00:00:00 2001 From: saxon Date: Thu, 13 Dec 2018 17:13:34 +1030 Subject: [PATCH] mts: actually updating time and gps now --- stream/mts/encoder.go | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index 95dbb441..78cbf2b2 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -34,7 +34,6 @@ import ( "bitbucket.org/ausocean/av/stream/mts/pes" "bitbucket.org/ausocean/av/stream/mts/psi" - "fmt" ) var ( @@ -188,27 +187,23 @@ func (e *Encoder) writePSI() error { return err } - /* - // Update pmt table time and gps - err = psi.UpdateTime(pmtTable, metaData.time) - if err != nil { - return err - } - err = psi.UpdateGps(pmtTable, metaData.gps) - if err != nil { - return nil - } - */ + // Update pmt table time and gps + err = psi.UpdateTime(pmtTable, metaData.time) + if err != nil { + return err + } + err = psi.UpdateGps(pmtTable, metaData.gps) + if err != nil { + return nil + } - packet := addPadding(pmtTable) - fmt.Println(len(pmtTable)) // Create mts packet from pmt table pmtPkt := Packet{ PUSI: true, PID: pmtPid, CC: e.ccFor(pmtPid), AFC: hasPayload, - Payload: packet, + Payload: addPadding(pmtTable), } _, err = e.dst.Write(pmtPkt.Bytes()) if err != nil {