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

Fix errors and warnings when importing Gst with gst-python >= 1.5.2 #1433

Merged
merged 3 commits into from Feb 8, 2016

Conversation

trygveaa
Copy link
Member

@trygveaa trygveaa commented Feb 7, 2016

With gst-python >= 1.5.2, a NotInitialized exception is thrown if Gst.is_initialized is called before Gst.init. This removes the Gst.is_initialized check, as Gst.init should be a noop if run again after the first call. This also adds an argument to Gst.init as gst-python >= 1.5.2 requires that as well.

Additionally, after fixing that, I got some warnings when importing GstPbutils before calling Gst.init, so that import is moved below the init, which removed the warnings.

This fixes #1432.

As of gst-python 1.5.2, the init call requires one argument. The
argument is a list of the command line options. I don't think we need to
send any.

This relates to mopidy#1432.
As of gst-python 1.5.2, Gst.is_initialized throws a NotInitialized
exception if run before Gst.init. Gst.init should be a noop if run again
after the first call, so this should be safe.

This fixes mopidy#1432.
With gst-python 1.6.2, importing GstPbutils before calling Gst.init
gives some warnings.
@trygveaa
Copy link
Member Author

trygveaa commented Feb 7, 2016

Someone with gst-python < 1.5.2 (e.g. Debian Jessie or Ubuntu), please test this.

@trygveaa
Copy link
Member Author

trygveaa commented Feb 8, 2016

Hm, I still get this warning from time to time with this branch as well. Though, most of the time, I don't get it. The same is the case for the develop branch.

sys:1: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.

@jodal jodal self-assigned this Feb 8, 2016
jodal added a commit that referenced this pull request Feb 8, 2016
Fix errors and warnings when importing Gst with gst-python >= 1.5.2
@jodal jodal merged commit c4da2c2 into mopidy:develop Feb 8, 2016
@jodal
Copy link
Member

jodal commented Feb 8, 2016

We should probably open upstream bugs about that:

  • Gst.init() in the overrides is stricter about the arguments than the real_init.
  • Gst.is_initialized() isn't exempted, unlike init(), init_check(), and deinit().

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

Successfully merging this pull request may close these issues.

Gst.NotInitialized exception on startup
2 participants