Python Discoverer crash

Matt Veenstra matt at
Thu Mar 3 12:21:00 PST 2011

In stress testing my app.  I eventually crash when using this class to
get duration.  It seems to crash after about 60 to 100 calls.

The error looks
( GStreamer-CRITICAL **:
gst_poll_get_read_gpollfd: assertion `set != NULL' failed

class cMediaTool:
	# theFile is a local file.  Is not tested with proper URI. expects
format file:///
	# mv this expects a/v file.  Fails if not.
	def OnDiscovered(self, discoverer, ismedia, infile):
		print '\non_discovered:', infile
		self.last_duration = 0
		# we always want the shortest direction to avoid a/v sync issues.
		if (discoverer.videolength >= discoverer.audiolength):
			self.last_duration = discoverer.audiolength / gst.MSECOND
			self.last_duration = discoverer.videolength / gst.MSECOND
	# this creates its own mainloop to create synchronous call.
	# this might cause bad things ran inside another mainloop.
	def GetFileDuration(self, theFile):
		discoverer = Discoverer(theFile)
		discoverer.connect('discovered', self.OnDiscovered, theFile)
		# The MainLoop
		self.mainloop = gobject.MainLoop()
		del self.mainloop
		# del discoverer
		return self.last_duration

I call it in a loop like this.  Do I need to do some cleanup that I am missing.

				aMediaTool = cMediaTool()
				aVideoDuration = aMediaTool.GetFileDuration(aStream)


More information about the gstreamer-devel mailing list