also stop on errors

This commit is contained in:
j 2009-01-23 11:39:59 +05:30
parent ca83c75a9e
commit 7b062f9a4f

View file

@ -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()