From 8b1fa42dd38fac18a17864924f8fbeee2012df04 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Thu, 14 Sep 2023 13:57:33 -0700 Subject: [PATCH] sync set pipeline null --- pkg/gstreamer/pipeline.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/gstreamer/pipeline.go b/pkg/gstreamer/pipeline.go index 2060a2ab..54327518 100644 --- a/pkg/gstreamer/pipeline.go +++ b/pkg/gstreamer/pipeline.go @@ -157,7 +157,6 @@ func (p *Pipeline) Stop() { } if err := p.OnStop(); err != nil { - logger.Errorw("onStop failure", err) p.OnError(err) } @@ -165,10 +164,11 @@ func (p *Pipeline) Stop() { p.loop.Quit() } + if err := p.SetState(gst.StateNull); err != nil { + logger.Errorw("failed to set pipeline to null", err) + } + p.UpgradeState(StateFinished) - go func() { - _ = p.pipeline.SetState(gst.StateNull) - }() } func (p *Pipeline) DebugBinToDotData(details gst.DebugGraphDetails) string {