Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent duplicate glib main loop #25

Open
aldonogueira opened this issue Mar 10, 2017 · 2 comments
Open

Prevent duplicate glib main loop #25

aldonogueira opened this issue Mar 10, 2017 · 2 comments

Comments

@aldonogueira
Copy link

Since I'm new to GStreamer, it took a while for me to understand that MainLoop is actually the glib main loop, the same one that is called by gtk-rs. It's clear when you read the code though. My project had both MainLoop::spawn() and gtk::main() and then all kinds of weird intermittent errors occurred. Something it's not expected when you are writing Rust code.

What could we do to avoid this kind of problem?

  • Add dependency on glib (which one) and somehow detect duplicate loop
  • Add code to check main loop is already running
  • Proper documentation
@sdroege
Copy link

sdroege commented Apr 5, 2017

GLib allows multiple mainloops with different main contexts. The only clean solution here would be to depend on glib, and this crate seems to be the one that is most actively developed: https://docs.rs/glib/0.1.2/glib/

@sdroege
Copy link

sdroege commented Aug 9, 2017

This should be solved by using the bindings from https://github.com/sdroege/gstreamer-rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants