# HG changeset patch # User drewp@bigasterisk.com # Date 2013-06-12 23:48:32 # Node ID 331e67fa14929f0f9c2a0318182b397cae62b25b # Parent c2faa69099e6e128c40f0e1a0c30d06dc441f78e asco try to print gst error messages. untested Ignore-this: 137d6b933ed8a2502f7281e3a0ab5754 diff --git a/light9/ascoltami/player.py b/light9/ascoltami/player.py --- a/light9/ascoltami/player.py +++ b/light9/ascoltami/player.py @@ -71,12 +71,20 @@ class Player(object): """bus.add_signal_watch seems to be having no effect, but this works""" bus = self.pipeline.get_bus() mt = Gst.MessageType - msg = bus.poll(mt.EOS | mt.STREAM_STATUS, 0) + msg = bus.poll(mt.EOS | mt.STREAM_STATUS | mt.ERROR,# | mt.ANY, + 0) if msg is not None: - if msg.type == Gst.MessageType.EOS: + log.debug("bus message: %r %r", msg.src, msg.type) + # i'm trying to catch here a case where the pulseaudio + # output has an error, since that's otherwise kind of + # mysterious to diagnose. I don't think this is exactly + # working. + if msg.type == mt.ERROR: + log.error(repr(msg.parse_error())) + if msg.type == mt.EOS: if self.onEOS is not None: self.onEOS(self.getSong()) - if msg.type == Gst.MessageType.STREAM_STATUS: + if msg.type == mt.STREAM_STATUS: (statusType, _elem) = msg.parse_stream_status() if statusType == Gst.StreamStatusType.ENTER: self.setupAutostop()