forked from External/mediamtx
Add query as optional block for SRT publish and read (#2656)
This commit is contained in:
parent
3277765851
commit
4fa6c16c85
2 changed files with 25 additions and 21 deletions
|
|
@ -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))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue