mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-25 08:40:39 +08:00
allow using MTX_QUERY inside source (#3486)
this allows to pass query parameters to sources, for instance: source: rtsp://my_host/my_path?$MTX_QUERY sourceOnDemand: true
This commit is contained in:
@@ -17,9 +17,8 @@ import (
|
||||
|
||||
// Source is a SRT static source.
|
||||
type Source struct {
|
||||
ResolvedSource string
|
||||
ReadTimeout conf.StringDuration
|
||||
Parent defs.StaticSourceParent
|
||||
ReadTimeout conf.StringDuration
|
||||
Parent defs.StaticSourceParent
|
||||
}
|
||||
|
||||
// Log implements logger.Writer.
|
||||
@@ -32,7 +31,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error {
|
||||
s.Log(logger.Debug, "connecting")
|
||||
|
||||
conf := srt.DefaultConfig()
|
||||
address, err := conf.UnmarshalURL(s.ResolvedSource)
|
||||
address, err := conf.UnmarshalURL(params.ResolvedSource)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user