Changeset 1615
- Timestamp:
- 2005-11-08 13:34:43 (3 years ago)
- Files:
-
- annoamp/trunk/anxplayer.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
annoamp/trunk/anxplayer.py
r1614 r1615 113 113 taglist = message.parse_tag() 114 114 taglist.foreach(temp) 115 elif message.type == gst.MESSAGE_STATE_CHANGED:116 #When in the paused state we can get the duration. We are interested when the pipeline goes to pause and it hasn't already117 #been playing or been paused118 if message.parse_state_changed()[1] == gst.STATE_PAUSED and message.parse_state_changed()[0] < gst.STATE_PAUSED and message.src == self.bin:119 self.debug(str(message.type) + "=>" + str(message))120 print "Update duration."121 try:122 self.duration = self.bin.query_duration(gst.FORMAT_TIME)[0]/gst.SECOND123 self.debug("Update duration: " + str(self.duration) + " sec")124 self.duration_callback(self.duration)125 except:126 self.error("Please get the newest gst-python CVS HEAD.")127 115 elif message.type == gst.MESSAGE_ERROR: 128 116 self.error(message.parse_error()) … … 137 125 138 126 self.pause() #we'll be in a state where we can seek, if necessary 127 try: 128 self.duration = self.bin.query_duration(gst.FORMAT_TIME)[0]/gst.SECOND 129 self.debug("Update duration: " + str(self.duration) + " sec") 130 self.duration_callback(self.duration) 131 except: 132 self.error("Please get the newest gst-python CVS HEAD.") 139 133 140 134 self.pos = -1