Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#225 Make media player work with GStreamer 1.0 and behave reasonably with GStreamer 0.10

Lars Windolf

TL;DR: Make it work on GStreamer 1.0, get rid of warnings on GStreamer 0.10.

The media player in current Liferea (1.10RC3) doesn't work with GStreamer 1.0, and has problems on 0.10. With 0.10, when the media player plugin gets activated, this warning is seen on the console:

Traceback (most recent call last):
  File "/home/simon/.local/share/liferea/plugins/media-player.py", line 26, in __init__
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
TypeError: add_signal_watch_full() takes exactly 2 arguments (1 given)

This is because bus.add_signal_watch_full() should really be bus.add_signal_watch(). There's no need for the full version of the API that also includes an argument for setting event source priority. The consequence of this bug is that the message signal handler is never called and none of the code in __init__ after this call is run. You can see this by playing a audio file until the end, the player doesn't change to "stop" mode, it just stops moving the slider. Here is a simple test case with a short audio file enclosure.

After changing this, new problems appear. You'll see lots of warning messages about how the message variable is None. (Possibly this is also related to the crash Lars reported here.) The problem appears to be a fundamental problem with GStreamer 0.10 and PyGObject - this simply doesn't work, and it appears that no fix is coming since it would break ABI compatibility. See: mailing list thread, pygobject bug, useful page from Novacut wiki, simple test code.

When trying to get things work properly on 0.10, all kinds of weird bugs have appeared. However, we can't easily force GStreamer 1.0 for just the media player. GStreamer is already linked to the liferea binary, WebKitGTK+ brings it in, so we have to use the same version that uses. On e.g. Ubuntu 12.04, this is GStreamer 0.10, and I think we want Liferea to be easily installed on such a recent system.

My proposed patch, then, is to:

  • Make things work properly on GStreamer 1.0. This entails changing "playbin2" to "playbin" and connecting to the signals in a simpler way; the Gst.Message.* constants seem to be have changed and this seems to be the recommended way.
  • Make things work as well as they can on GStreamer 0.10. I.e., as well as it already does, but without warnings.

Commit message contains another story of the changes. :-)

Regards, Simon Kågedal Reimer

1 Attachments


  • Lars Windolf
    Lars Windolf

    • status: open --> open-accepted
    • assigned_to: Lars Windolf
    • Group: Unstable --> Stable
  • Lars Windolf
    Lars Windolf

    Merged for 1.10.1. Thanks for the great work and detailed investigation!!!

  • Lars Windolf
    Lars Windolf

    Released with 1.10.1

  • Lars Windolf
    Lars Windolf

    • status: open-accepted --> closed-accepted