diff --git a/src/common.rs b/src/common.rs index ed9a1fe..ea48f2a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -12,6 +12,10 @@ use gtk::glib; pub fn init() -> Result<()> { std::env::set_var("GST_XINITTHREADS", "1"); gst::init()?; + #[cfg(feature = "gtk4-plugin")] + { + gstgtk4::plugin_register_static().expect("Failed to register gstgtk4 plugin"); + } gtk::init()?; Ok(()) } diff --git a/src/gps/player.rs b/src/gps/player.rs index c692c85..2b5dcca 100644 --- a/src/gps/player.rs +++ b/src/gps/player.rs @@ -77,10 +77,6 @@ impl Player { current_state: Cell::new(PipelineState::Stopped), n_video_sink: Cell::new(0), })); - #[cfg(feature = "gtk4-plugin")] - { - gstgtk4::plugin_register_static().expect("Failed to register gstgtk4 plugin"); - } Ok(pipeline) }