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.bus.add_signal_watch()
self.watch_id = self.bus.connect("message", self.onBusMessage) self.watch_id = self.bus.connect("message", self.onBusMessage)
self.pipeline.set_state(gst.STATE_PAUSED) self.pipeline.set_state(gst.STATE_PAUSED)
self.pipeline.get_state() self.pipeline.get_state()
@ -59,6 +58,7 @@ class Info:
self.metadata["duration"] = self.duration/gst.MSECOND self.metadata["duration"] = self.duration/gst.MSECOND
self.mainloop.run() self.mainloop.run()
if 'video-codec' in self.tags: if 'video-codec' in self.tags:
self.metadata['video-codec'] = codec_list.get(self.tags['video-codec'], self.tags['video-codec']) self.metadata['video-codec'] = codec_list.get(self.tags['video-codec'], self.tags['video-codec'])
if 'audio-codec' in self.tags: if 'audio-codec' in self.tags:
@ -122,6 +122,8 @@ class Info:
if message.type == gst.MESSAGE_TAG: if message.type == gst.MESSAGE_TAG:
for key in message.parse_tag().keys(): for key in message.parse_tag().keys():
self.tags[key] = message.structure[key] 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: if message.src == self.pipeline and message.type == gst.MESSAGE_EOS:
self.quit() self.quit()