mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-11 11:30:13 +08:00
修复DTS生成时遇到PTS超过循环的情况
This commit is contained in:
17
common/dtsestimator_test.go
Normal file
17
common/dtsestimator_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDts(t *testing.T) {
|
||||
t.Run(t.Name(), func(t *testing.T) {
|
||||
dtsg := NewDTSEstimator()
|
||||
var pts uint32 = 0xFFFFFFFF - 5
|
||||
for i := 0; i < 10; i++ {
|
||||
dts := dtsg.Feed(pts)
|
||||
pts++
|
||||
t.Logf("dts=%d", dts)
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user