mts: set nalbasedpsi to false for audio

This commit is contained in:
Trek H 2019-09-12 23:12:55 +09:30
parent e7a02a818f
commit c3df750175
1 changed files with 3 additions and 1 deletions

View File

@ -150,10 +150,12 @@ type Encoder struct {
func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder { func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder {
var mPid int var mPid int
var sid byte var sid byte
nbp := true
switch mediaType { switch mediaType {
case EncodeAudio: case EncodeAudio:
mPid = AudioPid mPid = AudioPid
sid = audioStreamID sid = audioStreamID
nbp = false
case EncodeH265: case EncodeH265:
mPid = VideoPid mPid = VideoPid
sid = H265ID sid = H265ID
@ -180,7 +182,7 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder {
writePeriod: time.Duration(float64(time.Second) / rate), writePeriod: time.Duration(float64(time.Second) / rate),
ptsOffset: ptsOffset, ptsOffset: ptsOffset,
nalBasedPSI: true, nalBasedPSI: nbp,
pktCount: 8, pktCount: 8,