rtp*: move time decoder into own package

This commit is contained in:
aler9
2022-01-18 10:44:44 +01:00
parent 51ab931caa
commit 17f05635dd
6 changed files with 75 additions and 108 deletions

View 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)
}