mirror of
https://github.com/datarhei/core.git
synced 2025-10-08 17:30:52 +08:00
Merge branch 'dev' into srt
This commit is contained in:
@@ -729,7 +729,9 @@ func (r *restream) validateInputAddress(address, basedir string) (string, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *restream) validateOutputAddress(address, basedir string) (string, bool, error) {
|
func (r *restream) validateOutputAddress(address, basedir string) (string, bool, error) {
|
||||||
if strings.Contains(address, "|") {
|
// If the address contains a "|" or it starts with a "[", then assume that it
|
||||||
|
// is an address for the tee muxer.
|
||||||
|
if strings.Contains(address, "|") || strings.HasPrefix(address, "[") {
|
||||||
addresses := strings.Split(address, "|")
|
addresses := strings.Split(address, "|")
|
||||||
|
|
||||||
isFile := false
|
isFile := false
|
||||||
|
@@ -469,6 +469,7 @@ func TestOutputAddressValidation(t *testing.T) {
|
|||||||
"-": {"pipe:", false},
|
"-": {"pipe:", false},
|
||||||
"/core/data/foobar|http://example.com": {"file:/core/data/foobar|http://example.com", false},
|
"/core/data/foobar|http://example.com": {"file:/core/data/foobar|http://example.com", false},
|
||||||
"/core/data/foobar|/etc/passwd": {"/core/data/foobar|/etc/passwd", true},
|
"/core/data/foobar|/etc/passwd": {"/core/data/foobar|/etc/passwd", true},
|
||||||
|
"[f=mpegts]udp://10.0.1.255:1234/": {"[f=mpegts]udp://10.0.1.255:1234/", false},
|
||||||
"[f=null]-|[f=null]-": {"[f=null]pipe:|[f=null]pipe:", false},
|
"[f=null]-|[f=null]-": {"[f=null]pipe:|[f=null]pipe:", false},
|
||||||
"[onfail=ignore]/core/data/archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/": {"[onfail=ignore]file:/core/data/archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/", false},
|
"[onfail=ignore]/core/data/archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/": {"[onfail=ignore]file:/core/data/archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/", false},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user