From 05fd7c37d1d4bdf67ba3e63ebcb076a6e01add7e Mon Sep 17 00:00:00 2001 From: saxon Date: Thu, 13 Dec 2018 17:06:39 +1030 Subject: [PATCH] psi: fixed issue with std psi --- stream/mts/encoder.go | 7 +++++-- stream/mts/psi/std.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index e6f35728..95dbb441 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -34,6 +34,7 @@ import ( "bitbucket.org/ausocean/av/stream/mts/pes" "bitbucket.org/ausocean/av/stream/mts/psi" + "fmt" ) var ( @@ -63,7 +64,7 @@ func GpsMeta(g string) { func init() { patTable = psi.StdPat.Bytes() - pmtTable = psi.StdPmt.Bytes() + pmtTable = psi.StdPmtTimeGps.Bytes() } const ( @@ -199,13 +200,15 @@ func (e *Encoder) writePSI() error { } */ + 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: addPadding(pmtTable), + Payload: packet, } _, err = e.dst.Write(pmtPkt.Bytes()) if err != nil { diff --git a/stream/mts/psi/std.go b/stream/mts/psi/std.go index 34647821..95aaf806 100644 --- a/stream/mts/psi/std.go +++ b/stream/mts/psi/std.go @@ -81,7 +81,7 @@ var ( Pf: 0x00, Tid: 0x02, Ssi: true, - Sl: uint16(0x12), + Sl: uint16(0x3e), Tss: &TSS{ Tide: uint16(0x01), V: 0,