Commit 150527f7 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Fix Player constructor on GStreamer 1.12 if a video renderer or signal dispatcher are given

parent b4cb81cd
......@@ -19,17 +19,16 @@ impl Player {
signal_dispatcher: Option<&PlayerSignalDispatcher>,
) -> Player {
assert_initialized_main_thread!();
let video_renderer = video_renderer.to_glib_full();
let signal_dispatcher = signal_dispatcher.to_glib_full();
let (major, minor, _, _) = gst::version();
if (major, minor) > (1, 12) {
let video_renderer = video_renderer.to_glib_full();
let signal_dispatcher = signal_dispatcher.to_glib_full();
unsafe { from_glib_full(ffi::gst_player_new(video_renderer, signal_dispatcher)) }
} else {
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13 in
// https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/gst-libs/gst/player/gstplayer.c?id=634cd87c76f58b5e1383715bafd5614db825c7d1
let video_renderer = video_renderer.to_glib_none();
let signal_dispatcher = signal_dispatcher.to_glib_none();
unsafe { from_glib_none(ffi::gst_player_new(video_renderer.0, signal_dispatcher.0)) }
unsafe { from_glib_none(ffi::gst_player_new(video_renderer, signal_dispatcher)) }
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment