Skip to content

Commit

Permalink
test: add unit tests to fragment.go
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee committed Nov 6, 2024
1 parent 1e25a36 commit 4fe0f59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mp4/fragment.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,11 @@ func (f *Fragment) GetSampleNrFromTime(trex *TrexBox, sampleTime uint64) (uint32
if baseDecodeTime > sampleTime {
return 0, fmt.Errorf("sampleTime %d less that baseMediaDecodeTime %d", sampleTime, baseDecodeTime)
}
defaultSampleDuration := uint32(0)
deltaTime := sampleTime - baseDecodeTime
defaultSampleDuration := trex.DefaultSampleDuration
if trex != nil {
defaultSampleDuration = trex.DefaultSampleDuration
}
if traf.Tfhd.HasDefaultSampleDuration() {
defaultSampleDuration = traf.Tfhd.DefaultSampleDuration
}
Expand Down

0 comments on commit 4fe0f59

Please sign in to comment.