mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-14 18:54:54 +00:00
fix tests
This commit is contained in:
parent
dffe63f1bc
commit
2c485f918b
@ -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{}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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)...),
|
||||
|
Loading…
Reference in New Issue
Block a user