revid: mts encoder uses exported pids

This commit is contained in:
Trek H 2019-06-06 00:28:26 +09:30
parent 7b4daed4a6
commit 3e2ff49420
2 changed files with 6 additions and 10 deletions

View File

@ -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,
},
}

View File

@ -45,6 +45,7 @@ const (
PatPid = 0
PmtPid = 4096
VideoPid = 256
AudioPid = 210
)
// StreamID is the id of the first stream.