diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index b9189c4b..e921248f 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -37,8 +37,7 @@ import ( ) const ( - psiPacketSize = 184 - psiSendCount = 7 + psiSndCnt = 7 ) type MetaData struct { @@ -209,14 +208,14 @@ func (e *Encoder) writePSI() error { if err != nil { return err } - e.psiCount = psiSendCount + e.psiCount = psiSndCnt return nil } // addPadding adds an appropriate amount of padding to a pat or pmt table for // addition to an mpegts packet func addPadding(d []byte) []byte { - for len(d) < psiPacketSize { + for len(d) < psi.PktLen { d = append(d, 0xff) } return d diff --git a/stream/mts/psi/psi.go b/stream/mts/psi/psi.go index 56abc260..4db81a59 100644 --- a/stream/mts/psi/psi.go +++ b/stream/mts/psi/psi.go @@ -30,6 +30,11 @@ import ( "hash/crc32" ) +// Misc consts +const ( + PktLen = 184 +) + // Lengths of section definitions const ( ESSDDefLen = 5