mts: some more const naming improvements

This commit is contained in:
saxon 2018-12-27 13:29:08 +10:30
parent 3a872d46c8
commit 49a6acbde8
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -30,6 +30,11 @@ import (
"hash/crc32"
)
// Misc consts
const (
PktLen = 184
)
// Lengths of section definitions
const (
ESSDDefLen = 5