pygst: The "about-to-finish" event fails to play next song (gapless playing) in Python

Eduardo Matus ematus at gmail.com
Tue Dec 20 12:18:20 PST 2011


You have to set the pipeline state to playing again

On Tue, Dec 20, 2011 at 1:57 PM, Ralph Heinkel <ralph.heinkel at web.de> wrote:

> Hi,
> following code ("stolen" from eurion.net...) does not replay the same song
> (or any other song) set in about_to_finish() event callback method. The
> event method is entered (verified by temporarily added print statements),
> but the player just stops after playing the first song.
>
> I'm using (opensuse 12.1) linux, gstreamer 0.10.35, gst-python 0.10.22
>
> Am I missing anything? Any help would be appreciated.
>
> Thanks,
>
> Ralph
>
> ------------------------------**------------
> #!/usr/bin/python
> # code from http://www.eurion.net/python-**snippets/snippet/Gapless%**
> 20playback.html<http://www.eurion.net/python-snippets/snippet/Gapless%20playback.html>
> import pygst
> pygst.require("0.10")
> import gst, sys, gobject
>
> class Player:
>    def __init__(self, filename):
>        self.filename = filename
>        self.player = gst.element_factory_make("**playbin2", "player")
>        self.player.set_property("uri"**, filename)
>        self.player.connect("about-to-**finish", self.about_to_finish)
>
>    def run(self):
>        self.player.set_state(gst.**STATE_PLAYING)
>        loop = gobject.MainLoop()
>        loop.run()
>
>    def about_to_finish(self, player):
>        player.set_property("uri", self.filename)
>
> if __name__ == "__main__":
>    gobject.threads_init()
>    player = Player("file:///path/to/song.**ogg")
>    player.run()
>
>
> ______________________________**_________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.**freedesktop.org<gstreamer-devel at lists.freedesktop.org>
> http://lists.freedesktop.org/**mailman/listinfo/gstreamer-**devel<http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel>
>



-- 
Eduardo Matus Coquelet
Ingeniero Civil Informático y Telecomunicaciones.
Celular: 77113825
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111220/58d1871a/attachment.html>


More information about the gstreamer-devel mailing list