From 86c718ae04d2b51883278c481395ce87b1f11c61 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Tue, 9 Feb 2021 22:13:16 +0100 Subject: [PATCH] forbid usage of sourceOnDemand when source is not 'record' --- internal/conf/path.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/conf/path.go b/internal/conf/path.go index 7d7e0152..ec867805 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -197,6 +197,12 @@ func (pconf *PathConf) fillAndCheck(name string) error { return fmt.Errorf("invalid source: '%s'", pconf.Source) } + if pconf.SourceOnDemand { + if pconf.Source != "record" { + return fmt.Errorf("'sourceOnDemand' is useless when source is not 'record', since the stream is not provided by a publisher, but by a fixed source") + } + } + if pconf.SourceOnDemandStartTimeout == 0 { pconf.SourceOnDemandStartTimeout = 10 * time.Second }