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

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