psi: using Desc instead of Descriptor

This commit is contained in:
saxon 2018-12-05 21:47:16 +10:30
parent fe11ce6f08
commit 2a589be6bf
1 changed files with 12 additions and 12 deletions

View File

@ -1,8 +1,8 @@
package psi package psi
const ( const (
ESSDHeadLen = 5 ESSDHeadLen = 5
DescriptorHeadLen = 2 DescHeadLen = 2
) )
// Program specific information // Program specific information
@ -40,18 +40,18 @@ type PAT struct {
// Program mapping table, implements SD // Program mapping table, implements SD
type PMT struct { type PMT struct {
pcrpid uint16 // Program clock reference pid pcrpid uint16 // Program clock reference pid
pil uint16 // Program info length pil uint16 // Program info length
pd []Descriptor // Program descriptors pd []Desc // Program descriptors
essd []ESSD // Elementary stream specific data essd []ESSD // Elementary stream specific data
} }
// Elementary stream specific data // Elementary stream specific data
type ESSD struct { type ESSD struct {
st byte // Stream type st byte // Stream type
epid byte // Elementary pid epid byte // Elementary pid
esil uint16 // Elementary stream esil uint16 // Elementary stream
esd []Descriptor // Elementary stream desriptors esd []Desc // Elementary stream desriptors
} }
// Descriptor // Descriptor
@ -82,8 +82,8 @@ func (p *PMT) Fill(space []byte) error {
return nil return nil
} }
func (d *Descriptor) Fill(space []byte) error { func (d *Desc) Fill(space []byte) error {
checkSpace(space, DescriptorHeadLen+int(d.dl)) checkSpace(space, DescHeadLen+int(d.dl))
space[0] = d.dt space[0] = d.dt
space[1] = d.dl space[1] = d.dl
copy(space[2:], d.dd) copy(space[2:], d.dd)