From e6ee173eae829b4348bdad8bb02acede91a50c50 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 13 Jul 2005 15:14:51 +0000 Subject: [PATCH] examples/pipeline-tester (Window.on_message): Handle errors. Original commit message from CVS: 2005-07-13 Andy Wingo * examples/pipeline-tester (Window.on_message): Handle errors. (Window.play): Drain messages from bus before setting pipe to NULL. --- ChangeLog | 6 ++++++ examples/pipeline-tester | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index ba28b026a3..03e438ca74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-07-13 Andy Wingo + + * examples/pipeline-tester (Window.on_message): Handle errors. + (Window.play): Drain messages from bus before setting pipe to + NULL. + 2005-07-13 Edward Hervey * Makefile.am: (install-data-local): diff --git a/examples/pipeline-tester b/examples/pipeline-tester index 857c296231..97a7a4456f 100755 --- a/examples/pipeline-tester +++ b/examples/pipeline-tester @@ -145,11 +145,15 @@ class Window(gtk.Window): if secondary: m.format_secondary_text(secondary) m.run() + m.destroy() def on_message(self, bus, message): t = message.type if t == gst.MESSAGE_STATE_CHANGED: pass + elif t == gst.MESSAGE_ERROR: + err, debug = message.parse_error() + self.error("%s" % err, debug) else: print '%s: %s:' % (message.src.get_path_string(), message.type.value_nicks[1]) @@ -168,6 +172,9 @@ class Window(gtk.Window): return False watch_id = pipeline.get_bus().add_watch(self.on_message) if pipeline.set_state(gst.STATE_PLAYING) != gst.STATE_SUCCESS: + # make sure we get error messages + while gtk.events_pending(): + gtk.main_iteration() pipeline.set_state(gst.STATE_NULL) gobject.source_remove(watch_id) return False