Skip to content

Commit

Permalink
playback: decrease concatenation tolerance to 0.5 secs (#3199)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Apr 7, 2024
1 parent c263fc6 commit b64e082
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/playback/fmp4.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

const (
sampleFlagIsNonSyncSample = 1 << 16
concatenationTolerance = 1 * time.Second
concatenationTolerance = 500 * time.Millisecond
fmp4Timescale = 90000
)

Expand Down Expand Up @@ -266,8 +266,6 @@ func fmp4ReadMaxDuration(r io.ReadSeeker) (time.Duration, error) {
return 0, fmt.Errorf("invalid tfdt box: %w", err)
}

elapsed := tfdt.BaseMediaDecodeTimeV1

// parse trun

_, err = io.ReadFull(r, buf)
Expand All @@ -294,6 +292,8 @@ func fmp4ReadMaxDuration(r io.ReadSeeker) (time.Duration, error) {
return 0, fmt.Errorf("invalid trun box: %w", err)
}

elapsed := tfdt.BaseMediaDecodeTimeV1

for _, entry := range trun.Entries {
elapsed += uint64(entry.SampleDuration)
}
Expand Down

0 comments on commit b64e082

Please sign in to comment.