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;