From 5d3340dd51a4017ac12e4196ff0b6f3933355379 Mon Sep 17 00:00:00 2001 From: Vladimir Romashchenko Date: Thu, 19 Sep 2024 21:28:42 -0400 Subject: [PATCH] No need to check for gst::init --- src/video.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/video.rs b/src/video.rs index 0adacd0..dd0ce27 100644 --- a/src/video.rs +++ b/src/video.rs @@ -121,10 +121,7 @@ impl Video { /// Expects an appsink plugin to be present with name set to `iced_video` and caps to /// `video/x-raw,format=RGBA,pixel-aspect-ratio=1/1` pub fn from_pipeline>(pipeline: S, is_live: Option) -> Result { - if !gst::INITIALIZED.load(Ordering::SeqCst) { - gst::init()?; - } - + gst::init()?; let pipeline = gst::parse::launch(pipeline.as_ref())? .downcast::() .map_err(|_| Error::Cast)?; @@ -139,11 +136,9 @@ impl Video { pipeline: gst::Pipeline, is_live: Option, ) -> Result { + gst::init()?; static NEXT_ID: AtomicU64 = AtomicU64::new(0); let id = NEXT_ID.fetch_add(1, Ordering::SeqCst); - if !gst::INITIALIZED.load(Ordering::SeqCst) { - gst::init()?; - } let mut live = false;