<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Eduardo,<br>
    so according to your hint I changed the method to<br>
    <br>
    &nbsp;&nbsp; def about_to_finish(self, player):<br>
    &nbsp; &nbsp; &nbsp; &nbsp;player.set_property("uri", self.filename)<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; player.set_state(gst.STATE_PLAYING)<br>
    <br>
    but unfortunately this did not help, it still only plays the first
    song. I also tried to set the state first to STATE_NULL but then I
    got a lengthy error message that this is not allowed from within the
    event thread, and the whole thing went down with a segmentation
    fault.<br>
    <br>
    Ralph<br>
    <br>
    On 20.12.11 21:18, Eduardo Matus wrote:
    <blockquote
cite="mid:CAP-mnwCKGczuvc+x1c5Vzuaw_RS6VNXgipsXee6iB=sOPgWnUQ@mail.gmail.com"
      type="cite">You have to set the pipeline state to playing again<br>
      <br>
      <div class="gmail_quote">On Tue, Dec 20, 2011 at 1:57 PM, Ralph
        Heinkel <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:ralph.heinkel@web.de">ralph.heinkel@web.de</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
          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.<br>
          <br>
          I'm using (opensuse 12.1) linux, gstreamer 0.10.35, gst-python
          0.10.22<br>
          <br>
          Am I missing anything? Any help would be appreciated.<br>
          <br>
          Thanks,<br>
          <br>
          Ralph<br>
          <br>
          ------------------------------------------<br>
          #!/usr/bin/python<br>
          # code from <a moz-do-not-send="true"
href="http://www.eurion.net/python-snippets/snippet/Gapless%20playback.html"
            target="_blank">http://www.eurion.net/python-snippets/snippet/Gapless%20playback.html</a><br>
          import pygst<br>
          pygst.require("0.10")<br>
          import gst, sys, gobject<br>
          <br>
          class Player:<br>
          &nbsp; &nbsp;def __init__(self, filename):<br>
          &nbsp; &nbsp; &nbsp; &nbsp;self.filename = filename<br>
          &nbsp; &nbsp; &nbsp; &nbsp;self.player = gst.element_factory_make("playbin2",
          "player")<br>
          &nbsp; &nbsp; &nbsp; &nbsp;self.player.set_property("uri", filename)<br>
          &nbsp; &nbsp; &nbsp; &nbsp;self.player.connect("about-to-finish",
          self.about_to_finish)<br>
          <br>
          &nbsp; &nbsp;def run(self):<br>
          &nbsp; &nbsp; &nbsp; &nbsp;self.player.set_state(gst.STATE_PLAYING)<br>
          &nbsp; &nbsp; &nbsp; &nbsp;loop = gobject.MainLoop()<br>
          &nbsp; &nbsp; &nbsp; &nbsp;loop.run()<br>
          <br>
          &nbsp; &nbsp;def about_to_finish(self, player):<br>
          &nbsp; &nbsp; &nbsp; &nbsp;player.set_property("uri", self.filename)<br>
          <br>
          if __name__ == "__main__":<br>
          &nbsp; &nbsp;gobject.threads_init()<br>
          &nbsp; &nbsp;player = Player(<a class="moz-txt-link-rfc2396E" href="file:///path/to/song.ogg">"file:///path/to/song.ogg"</a>)<br>
          &nbsp; &nbsp;player.run()<br>
          <br>
          <br>
          _______________________________________________<br>
          gstreamer-devel mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:gstreamer-devel@lists.freedesktop.org"
            target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
            target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
        </blockquote>
      </div>
      <br>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      Eduardo Matus Coquelet<br>
      Ingeniero Civil Inform&aacute;tico y Telecomunicaciones.<br>
      Celular: 77113825<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
  </body>
</html>