From 90efebdc91d17a2d9d37b21e519c3f2262f4d818 Mon Sep 17 00:00:00 2001 From: scruzin Date: Wed, 10 Jul 2019 10:17:34 +0930 Subject: [PATCH] Added BasePMT which is a PMT without specific data, and removed StandardPMT. --- container/mts/encoder.go | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/container/mts/encoder.go b/container/mts/encoder.go index c47537bf..883e3a5e 100644 --- a/container/mts/encoder.go +++ b/container/mts/encoder.go @@ -56,8 +56,8 @@ var ( }, } - // Standard PMT is a minimal PMT. - StandardPMT = psi.PSI{ + // Base PMT is a minimal PMT without specific data. + BasePMT = psi.PSI{ Pf: 0x00, Tid: 0x02, Ssi: true, @@ -68,15 +68,6 @@ var ( Cni: true, Sn: 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 } - // StandardPmt is a minimal PMT, without descriptors for metadata. - pmt := StandardPMT - if sid != H264ID { - pmt.Tss.Sd = &psi.PMT{ - Pcrpid: 0x0100, - Pil: 0, - Essd: &psi.ESSD{ - St: byte(sid), - Epid: 0x0100, - Esil: 0x00, - }, - } + pmt := BasePMT + pmt.Tss.Sd = &psi.PMT{ + Pcrpid: 0x0100, + Pil: 0, + Essd: &psi.ESSD{ + St: byte(sid), + Epid: 0x0100, + Esil: 0x00, + }, } pmtTable = pmt.Bytes()