This reverts commit 500d18b6c6.
This commit is contained in:
Alessandro Ros
2025-06-03 20:27:53 +02:00
committed by GitHub
parent c055c13442
commit c21c969a8c
10 changed files with 79 additions and 287 deletions

View File

@@ -97,13 +97,6 @@ func TestServerPublish(t *testing.T) {
},
}
n := 0
timeNow := func() time.Time {
d := time.Date(2009, 5, 20, 22, 15, 25, 427000, time.Local).Add(time.Duration(n) * 2 * time.Second)
n++
return d
}
s := &Server{
Address: "127.0.0.1:1935",
ReadTimeout: conf.Duration(10 * time.Second),
@@ -116,7 +109,6 @@ func TestServerPublish(t *testing.T) {
RunOnConnectRestart: false,
RunOnDisconnect: "",
ExternalCmdPool: nil,
TimeNow: timeNow,
PathManager: pathManager,
Parent: test.NilLogger,
}
@@ -154,6 +146,12 @@ func TestServerPublish(t *testing.T) {
err = w.Initialize()
require.NoError(t, err)
err = w.WriteH264(
2*time.Second, 2*time.Second, [][]byte{
{5, 2, 3, 4},
})
require.NoError(t, err)
<-path.streamCreated
recv := make(chan struct{})
@@ -168,7 +166,7 @@ func TestServerPublish(t *testing.T) {
require.Equal(t, [][]byte{
test.FormatH264.SPS,
test.FormatH264.PPS,
{5, 6, 7, 8},
{5, 2, 3, 4},
}, u.(*unit.H264).AU)
close(recv)
return nil
@@ -179,7 +177,7 @@ func TestServerPublish(t *testing.T) {
err = w.WriteH264(
3*time.Second, 3*time.Second, [][]byte{
{5, 6, 7, 8},
{5, 2, 3, 4},
})
require.NoError(t, err)
@@ -305,16 +303,8 @@ func TestServerRead(t *testing.T) {
})
}()
n := 0
timeNow := func() time.Time {
d := time.Date(2009, 5, 20, 22, 15, 25, 427000, time.Local).Add(time.Duration(n) * 2 * time.Second)
n++
return d
}
r := &rtmp.Reader{
Conn: conn,
TimeNow: timeNow,
Conn: conn,
}
err = r.Initialize()
require.NoError(t, err)