From 7b062f9a4f5ba924d943528e63c679e49c276eb8 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 23 Jan 2009 11:39:59 +0530 Subject: [PATCH] also stop on errors --- oxgst/info.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oxgst/info.py b/oxgst/info.py index 877d6f9..7b6dcb8 100644 --- a/oxgst/info.py +++ b/oxgst/info.py @@ -41,7 +41,6 @@ class Info: self.bus.add_signal_watch() self.watch_id = self.bus.connect("message", self.onBusMessage) - self.pipeline.set_state(gst.STATE_PAUSED) self.pipeline.get_state() @@ -57,8 +56,9 @@ class Info: if pad.get_peer() and pad.get_peer().query(q): format, self.duration = q.parse_duration() self.metadata["duration"] = self.duration/gst.MSECOND - + self.mainloop.run() + if 'video-codec' in self.tags: self.metadata['video-codec'] = codec_list.get(self.tags['video-codec'], self.tags['video-codec']) if 'audio-codec' in self.tags: @@ -122,6 +122,8 @@ class Info: if message.type == gst.MESSAGE_TAG: for key in message.parse_tag().keys(): self.tags[key] = message.structure[key] + if message.type == gst.MESSAGE_ERROR: + self.quit() if message.src == self.pipeline and message.type == gst.MESSAGE_EOS: self.quit()