gtkglsink: When setting to PLAYING from another thread causes a crash on Xorg
I am playing back a file from an SSH mount opened using a local path. I found that pipeline.set_state(Playing)
takes a second, so I assumed I could call it asynchronously with call_async
. However, that causes X assertion failures.
To reproduce, modify gtksink.rs
in the following way:
- pipeline
- .set_state(gst::State::Playing)
- .expect("Unable to set the pipeline to the `Playing` state");
+ pipeline.call_async(|pipeline| {
+ drop(
+ pipeline
+ .set_state(gst::State::Playing)
+ .expect("Unable to set the pipeline to the `Playing` state"),
+ )
+ });
and run the example with cargo run --features="gtksink v1_10" --bin gtksink
.
It will crash:
[xcb] Unknown sequence number while processing reply
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gtksink: xcb_io.c:641: _XReply: Assertion `!xcb_xlib_threads_sequence_lost' failed.
fish: “cargo run --features="gtksink v…” terminated by signal SIGABRT (Abort)
I'm not sure if it's something I'm doing wrong (what's the right way then?) or an issue with the bindings (something should be not Send or Sync?).
GNOME 3.36, Xorg session.