Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playback: decrease concatenation tolerance to 0.5 secs #3199

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading