diff --git a/gstreamer-validate/src/functions.rs b/gstreamer-validate/src/functions.rs index 298f47d51..772ed4927 100644 --- a/gstreamer-validate/src/functions.rs +++ b/gstreamer-validate/src/functions.rs @@ -4,9 +4,9 @@ use glib::translate::*; #[doc(alias = "gst_validate_init")] pub fn init() { - assert_initialized_main_thread!(); unsafe { ffi::gst_validate_init(); + crate::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst); } } @@ -28,3 +28,13 @@ pub fn setup_test_file(test_file: &str, use_fakesinks: bool) -> gst::Structure { )) } } + +#[cfg(test)] +mod tests { + + #[test] + fn test_init() { + gst::init().unwrap(); + crate::init(); + } +}