1
0
Fork 0
forked from External/mediamtx

Add query as optional block for SRT publish and read (#2656)

This commit is contained in:
Bohdan Cherniakh 2023-11-17 00:32:17 +02:00 committed by GitHub
parent 3277765851
commit 4fa6c16c85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 21 deletions

View file

@ -359,7 +359,7 @@ func TestPathRunOnRead(t *testing.T) {
case "srt":
conf := srt.DefaultConfig()
address, err := conf.UnmarshalURL("srt://localhost:8890?streamid=read:test")
address, err := conf.UnmarshalURL("srt://localhost:8890?streamid=read:test:query=value")
require.NoError(t, err)
err = conf.Validate()
@ -390,19 +390,11 @@ func TestPathRunOnRead(t *testing.T) {
byts, err := os.ReadFile(onReadFile)
require.NoError(t, err)
if ca == "srt" {
require.Equal(t, "test \n", string(byts))
} else {
require.Equal(t, "test query=value\n", string(byts))
}
require.Equal(t, "test query=value\n", string(byts))
byts, err = os.ReadFile(onUnreadFile)
require.NoError(t, err)
if ca == "srt" {
require.Equal(t, "test \n", string(byts))
} else {
require.Equal(t, "test query=value\n", string(byts))
}
require.Equal(t, "test query=value\n", string(byts))
})
}
}