pes: MaxPesSize to MaxPesLen

This commit is contained in:
saxon 2018-12-27 13:36:38 +10:30
parent 49a6acbde8
commit b28861d690
2 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ type Encoder struct {
frameInterval time.Duration frameInterval time.Duration
ptsOffset time.Duration ptsOffset time.Duration
tsSpace [PktLen]byte tsSpace [PktLen]byte
pesSpace [pes.MaxPesSize]byte pesSpace [pes.MaxPesLen]byte
psiCount int psiCount int

View File

@ -28,7 +28,7 @@ package pes
import () import ()
const MaxPesSize = 10000 const MaxPesLen = 10000
/* /*
The below data struct encapsulates the fields of an PES packet. Below is The below data struct encapsulates the fields of an PES packet. Below is
@ -95,8 +95,8 @@ type Packet struct {
} }
func (p *Packet) Bytes(buf []byte) []byte { func (p *Packet) Bytes(buf []byte) []byte {
if buf == nil || cap(buf) != MaxPesSize { if buf == nil || cap(buf) != MaxPesLen {
buf = make([]byte, 0, MaxPesSize) buf = make([]byte, 0, MaxPesLen)
} }
buf = buf[:0] buf = buf[:0]
buf = append(buf, []byte{ buf = append(buf, []byte{