fix tests

This commit is contained in:
aler9 2022-03-06 17:49:26 +01:00 committed by Alessandro Ros
parent dffe63f1bc
commit 2c485f918b
3 changed files with 13 additions and 7 deletions

View File

@ -221,6 +221,7 @@ func TestRTSPSourceDynamicH264Params(t *testing.T) {
require.NoError(t, err)
stream := gortsplib.NewServerStream(gortsplib.Tracks{track})
defer stream.Close()
s := gortsplib.Server{
Handler: &testServer{
@ -268,6 +269,8 @@ func TestRTSPSourceDynamicH264Params(t *testing.T) {
require.NoError(t, err)
stream.WritePacketRTP(0, pkts[0], true)
time.Sleep(1 * time.Second)
func() {
c := gortsplib.Client{}

View File

@ -218,7 +218,11 @@ func TestClient(t *testing.T) {
return nil
},
func(pts time.Duration, nalus [][]byte) {
require.Equal(t, [][]byte{{0x05}}, nalus)
require.Equal(t, [][]byte{
{7, 1, 2, 3},
{8},
{0x05},
}, nalus)
close(packetRecv)
},
func(pts time.Duration, aus [][]byte) {

View File

@ -33,10 +33,9 @@ func TestMuxerVideoAudio(t *testing.T) {
// group with IDR
err = m.WriteH264(2*time.Second, [][]byte{
{5}, // IDR
{9}, // AUD
{8}, // PPS
{7}, // SPS
{8}, // PPS
{5}, // IDR
})
require.NoError(t, err)
@ -124,8 +123,8 @@ func TestMuxerVideoAudio(t *testing.T) {
require.NoError(t, err)
require.Equal(t, &astits.Packet{
AdaptationField: &astits.PacketAdaptationField{
Length: 145,
StuffingLength: 138,
Length: 148,
StuffingLength: 141,
HasPCR: true,
PCR: &astits.ClockReference{},
RandomAccessIndicator: true,
@ -140,7 +139,7 @@ func TestMuxerVideoAudio(t *testing.T) {
0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x80,
0x05, 0x21, 0x00, 0x03, 0x5f, 0x91,
0, 0, 0, 1, 9, 240, // AUD
0, 0, 0, 1, 7, 1, 2, 3, // SPS
0, 0, 0, 1, 7, // SPS
0, 0, 0, 1, 8, // PPS
0, 0, 0, 1, 5, // IDR
}, bytes.Repeat([]byte{0xff}, 0)...),