From 7d11ff6303941bdbe607746b0d5ba489c105f943 Mon Sep 17 00:00:00 2001 From: nareix Date: Fri, 1 Apr 2016 17:30:35 +0800 Subject: [PATCH] fix stts entry sample count bug --- muxer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/muxer.go b/muxer.go index 289e066..3619e22 100644 --- a/muxer.go +++ b/muxer.go @@ -48,6 +48,7 @@ func (self *Muxer) newTrack() *Track { Header: &atom.MediaHeader{ TimeScale: 0, // fill later Duration: 0, // fill later + Language: 21956, }, Info: &atom.MediaInfo{ Sample: track.sample, @@ -190,6 +191,9 @@ func (self *Track) WriteSample(pts int64, dts int64, isKeyFrame bool, data []byt } func (self *Track) fillTrackAtom() (err error) { + if self.sampleIndex > 0 { + self.sttsEntry.Count++ + } if self.Type == H264 { self.sample.SampleDesc.Avc1Desc.Conf.Record, err = atom.CreateAVCDecoderConfRecord( self.sps,