mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-19 13:06:57 +00:00
playback: decrease concatenation tolerance to 0.5 secs (#3199)
This commit is contained in:
parent
c263fc6f7b
commit
b64e082253
@ -14,7 +14,7 @@ import (
|
||||
|
||||
const (
|
||||
sampleFlagIsNonSyncSample = 1 << 16
|
||||
concatenationTolerance = 1 * time.Second
|
||||
concatenationTolerance = 500 * time.Millisecond
|
||||
fmp4Timescale = 90000
|
||||
)
|
||||
|
||||
@ -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)
|
||||
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user