mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 07:37:07 +08:00
rtp*: move time decoder into own package
This commit is contained in:
24
pkg/rtptimedec/decoder_test.go
Normal file
24
pkg/rtptimedec/decoder_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package rtptimedec
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestOverflow(t *testing.T) {
|
||||
d := New(90000)
|
||||
var pts time.Duration
|
||||
|
||||
for _, ts := range []uint32{
|
||||
4294877296,
|
||||
90001,
|
||||
3240090001,
|
||||
565122706,
|
||||
} {
|
||||
pts = d.Decode(ts)
|
||||
}
|
||||
|
||||
require.Equal(t, 15*60*60*time.Second+2*time.Second, pts)
|
||||
}
|
Reference in New Issue
Block a user