diff --git a/server/internal/capture/broadcast.go b/server/internal/capture/broadcast.go index a3aa48c..f1e8133 100644 --- a/server/internal/capture/broadcast.go +++ b/server/internal/capture/broadcast.go @@ -22,7 +22,7 @@ type BroacastManagerCtx struct { started bool } -func broadcastNew(pipelineFn func(url string) (string, error), url string, started bool) *BroacastManagerCtx { +func broadcastNew(pipelineFn func(url string) (string, error), defaultUrl string) *BroacastManagerCtx { logger := log.With(). Str("module", "capture"). Str("submodule", "broadcast"). @@ -31,8 +31,8 @@ func broadcastNew(pipelineFn func(url string) (string, error), url string, start return &BroacastManagerCtx{ logger: logger, pipelineFn: pipelineFn, - url: url, - started: started, + url: defaultUrl, + started: defaultUrl != "", } } diff --git a/server/internal/capture/manager.go b/server/internal/capture/manager.go index 6346681..a566051 100644 --- a/server/internal/capture/manager.go +++ b/server/internal/capture/manager.go @@ -30,7 +30,7 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt // sinks broadcast: broadcastNew(func(url string) (string, error) { return NewBroadcastPipeline(config.AudioDevice, config.Display, config.BroadcastPipeline, url) - }, config.BroadcastUrl, config.BroadcastStarted), + }, config.BroadcastUrl), audio: streamSinkNew(config.AudioCodec, func() (string, error) { return NewAudioPipeline(config.AudioCodec, config.AudioDevice, config.AudioPipeline, config.AudioBitrate) }, "audio"), diff --git a/server/internal/config/capture.go b/server/internal/config/capture.go index d5caf0f..7dcf309 100644 --- a/server/internal/config/capture.go +++ b/server/internal/config/capture.go @@ -27,7 +27,6 @@ type Capture struct { // broadcast BroadcastPipeline string BroadcastUrl string - BroadcastStarted bool } func (Capture) Init(cmd *cobra.Command) error { @@ -222,5 +221,4 @@ func (s *Capture) Set() { s.BroadcastPipeline = viper.GetString("broadcast_pipeline") s.BroadcastUrl = viper.GetString("broadcast_url") - s.BroadcastStarted = s.BroadcastUrl != "" }