From 3e2ff49420ad23e8e12b309988a4188404ff196b Mon Sep 17 00:00:00 2001 From: Trek H Date: Thu, 6 Jun 2019 00:28:26 +0930 Subject: [PATCH] revid: mts encoder uses exported pids --- container/mts/encoder.go | 15 +++++---------- container/mts/mpegts.go | 1 + 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/container/mts/encoder.go b/container/mts/encoder.go index 3f7137f7..da7d4c5c 100644 --- a/container/mts/encoder.go +++ b/container/mts/encoder.go @@ -74,11 +74,6 @@ var ( ) const ( - sdtPid = 17 - patPid = 0 - pmtPid = 4096 - videoPid = 256 - audioPid = 210 H264ID = 27 H265ID = 36 audioStreamID = 0xc0 // First audio stream ID. @@ -133,13 +128,13 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder { var sid byte switch mediaType { case EncodeAudio: - mPid = audioPid + mPid = AudioPid sid = audioStreamID case EncodeH265: - mPid = videoPid + mPid = VideoPid sid = H265ID case EncodeH264: - mPid = videoPid + mPid = VideoPid sid = H264ID } @@ -181,8 +176,8 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder { streamID: sid, continuity: map[int]byte{ - patPid: 0, - pmtPid: 0, + PatPid: 0, + PmtPid: 0, mPid: 0, }, } diff --git a/container/mts/mpegts.go b/container/mts/mpegts.go index eb4bee5d..34544276 100644 --- a/container/mts/mpegts.go +++ b/container/mts/mpegts.go @@ -45,6 +45,7 @@ const ( PatPid = 0 PmtPid = 4096 VideoPid = 256 + AudioPid = 210 ) // StreamID is the id of the first stream.