diff --git a/ChangeLog b/ChangeLog index 92ebe11e17..5b656e3cd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-10-18 Andy Wingo + * examples/pipeline-tester: Fix for state change changes. + * gst/gstmessage.override (_wrap_gst_message_tp_repr): Add a repr for messages. (_wrap_gst_message_tp_repr): Is your message repr t00 sma11? diff --git a/examples/pipeline-tester b/examples/pipeline-tester index 029d7b717d..63c11d7de4 100755 --- a/examples/pipeline-tester +++ b/examples/pipeline-tester @@ -194,9 +194,11 @@ class Window(gtk.Window): m.format_secondary_text(secondary) m.run() m.destroy() - + self.stop() + def on_message(self, bus, message): t = message.type + print message if t == gst.MESSAGE_STATE_CHANGED: pass elif t == gst.MESSAGE_ERROR: @@ -227,18 +229,9 @@ class Window(gtk.Window): bus = pipeline.get_bus() bus.add_signal_watch() watch_id = bus.connect('message', self.on_message) - if pipeline.set_state(gst.STATE_PLAYING) != gst.STATE_CHANGE_SUCCESS: - # make sure we get error messages - while gtk.events_pending(): - gtk.main_iteration() - pipeline.set_state(gst.STATE_NULL) - bus.remove_signal_watch() - bus.disconnect(watch_id) - return False - else: - self.pipeline = pipeline - self.watch_id = watch_id - return True + self.pipeline = pipeline + self.watch_id = watch_id + pipeline.set_state(gst.STATE_PLAYING) def stop(self): bus = self.pipeline.get_bus() @@ -254,9 +247,9 @@ class Window(gtk.Window): self.button.set_label(gtk.STOCK_MEDIA_PLAY) self.playing = False else: - if self.play(): - self.playing = True - self.button.set_label(gtk.STOCK_MEDIA_STOP) + self.play() + self.playing = True + self.button.set_label(gtk.STOCK_MEDIA_STOP) if __name__ == '__main__': w = Window()