mirror of
https://github.com/bluenviron/mediamtx
synced 2025-03-07 21:07:40 +00:00
18 lines
388 B
Go
18 lines
388 B
Go
package h264
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestDTSEstimator(t *testing.T) {
|
|
est := NewDTSEstimator()
|
|
est.Feed(2 * time.Second)
|
|
est.Feed(2*time.Second - 200*time.Millisecond)
|
|
est.Feed(2*time.Second - 400*time.Millisecond)
|
|
dts := est.Feed(2*time.Second + 200*time.Millisecond)
|
|
require.Equal(t, 2*time.Second-400*time.Millisecond, dts)
|
|
}
|