Added BasePMT which is a PMT without specific data, and removed StandardPMT.

This commit is contained in:
scruzin 2019-07-10 10:17:34 +09:30
parent 7414317429
commit 90efebdc91
1 changed files with 11 additions and 23 deletions

View File

@ -56,8 +56,8 @@ var (
}, },
} }
// Standard PMT is a minimal PMT. // Base PMT is a minimal PMT without specific data.
StandardPMT = psi.PSI{ BasePMT = psi.PSI{
Pf: 0x00, Pf: 0x00,
Tid: 0x02, Tid: 0x02,
Ssi: true, Ssi: true,
@ -68,15 +68,6 @@ var (
Cni: true, Cni: true,
Sn: 0, Sn: 0,
Lsn: 0, Lsn: 0,
Sd: &psi.PMT{
Pcrpid: 0x0100,
Pil: 0,
Essd: &psi.ESSD{
St: H264ID,
Epid: 0x0100,
Esil: 0x00,
},
},
}, },
} }
) )
@ -170,18 +161,15 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder {
sid = H264ID sid = H264ID
} }
// StandardPmt is a minimal PMT, without descriptors for metadata. pmt := BasePMT
pmt := StandardPMT pmt.Tss.Sd = &psi.PMT{
if sid != H264ID { Pcrpid: 0x0100,
pmt.Tss.Sd = &psi.PMT{ Pil: 0,
Pcrpid: 0x0100, Essd: &psi.ESSD{
Pil: 0, St: byte(sid),
Essd: &psi.ESSD{ Epid: 0x0100,
St: byte(sid), Esil: 0x00,
Epid: 0x0100, },
Esil: 0x00,
},
}
} }
pmtTable = pmt.Bytes() pmtTable = pmt.Bytes()