Files
gortsplib/pkg/rtptime/encoder_test.go
Alessandro Ros f0540b4eee fix timestamp encode error after some hours (#206)
previous formula was: uint32(a + uint32(b))
this formula overflows two times, while it should overflow once.
new formula is: uint32(uint64(a) + uint64(b))
2023-03-14 17:55:06 +01:00

15 lines
203 B
Go

package rtptime
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestEncoder(t *testing.T) {
e := NewEncoder(90000, 12345)
ts := e.Encode(0)
require.Equal(t, uint32(12345), ts)
}