From 49a6acbde88200ea28849f5b74aad144289866a4 Mon Sep 17 00:00:00 2001 From: saxon Date: Thu, 27 Dec 2018 13:29:08 +1030 Subject: [PATCH] mts: some more const naming improvements --- stream/mts/encoder.go | 7 +++---- stream/mts/psi/psi.go | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) 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