Add packet index to mp4f finalize
This commit is contained in:
parent
5adbbcc01f
commit
b45acf05c3
@ -405,8 +405,8 @@ func (element *Stream) writePacketV3(pkt av.Packet, rawdur time.Duration, maxFra
|
|||||||
element.dts += element.timeToTs(rawdur)
|
element.dts += element.timeToTs(rawdur)
|
||||||
return got, out, nil
|
return got, out, nil
|
||||||
}
|
}
|
||||||
func (element *Muxer) Finalize() []byte {
|
func (element *Muxer) Finalize(pktIdx int8) []byte {
|
||||||
stream := element.streams[0]
|
stream := element.streams[pktIdx]
|
||||||
stream.moof.Tracks[0].Run.DataOffset = uint32(stream.moof.Len() + 8)
|
stream.moof.Tracks[0].Run.DataOffset = uint32(stream.moof.Len() + 8)
|
||||||
out := make([]byte, stream.moof.Len()+len(stream.buffer))
|
out := make([]byte, stream.moof.Len()+len(stream.buffer))
|
||||||
stream.moof.Marshal(out)
|
stream.moof.Marshal(out)
|
||||||
@ -415,7 +415,6 @@ func (element *Muxer) Finalize() []byte {
|
|||||||
stream.sampleIndex = 0
|
stream.sampleIndex = 0
|
||||||
stream.muxer.fragmentIndex++
|
stream.muxer.fragmentIndex++
|
||||||
return out
|
return out
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//PutU32BE func
|
//PutU32BE func
|
||||||
|
Loading…
Reference in New Issue
Block a user