rtsp: add random value to timestamp of tracks from other protocols (#3071)

This commit is contained in:
Alessandro Ros
2024-02-26 00:41:05 +01:00
committed by GitHub
parent da7c5744b1
commit b6db3121b5
26 changed files with 203 additions and 49 deletions

View File

@@ -10,14 +10,6 @@ import (
"github.com/bluenviron/mediamtx/internal/unit"
)
// avoid an int64 overflow and preserve resolution by splitting division into two parts:
// first add the integer part, then the decimal part.
func multiplyAndDivide(v, m, d time.Duration) time.Duration {
secs := v / d
dec := v % d
return (secs*m + dec*m/d)
}
// Processor cleans and normalizes streams.
type Processor interface {
// process a Unit.