[gst-devel] Meta Data and Tags - segfaults with discoverer.py

Christopher Backhouse cjbackhouse at gmail.com
Tue Oct 24 14:01:44 CEST 2006


Jason Gerard DeRose wrote:
 > In the Python bindings, gst/extend/discoverer.py is an excellent example
 > of an efficient meta data reading pipeline.  You can write the
 > equivalent in whatever language you are working with (if not Python).


I have also been looking for a fast tag-getter. And discoverer.py does 
seem to be exactly the right thing. So I throw together this program as 
proof of concept:


def ondisc(obj,got):
	if got:
		gtk.main_quit()

#snip - reading in all the fnames

for f in fnames:
	d=gst.extend.discoverer.Discoverer(f)
	d.discover()
	ident=d.connect('discovered',ondisc)
	print 'tags for ',f,':'
	gtk.main()
	d.disconnect(ident)
	for tag in d.tags.keys():
		print "%20s :\t" % tag, d.tags[tag]



The two problems I am having
1. When run on a large number of files occasionally you see a block of 
'tags for ...' with no corresponding tags printed out. As if the 
'discovered' handler was called whilst d.tags was still empty. The 
stranger thing is that it is different files each time. Anyway, I 
suspect that this is maybe a mistake on my part, is there a way I can be 
sure that I have all the tags a file has before I go onto the next one?

2. After a few hundred tracks (on average) I get a segfault. This is on 
different files every time and seemingly random. I assume that this has 
to be a bug in gstreamer. How would one go about debugging a python 
program that segfaults?




More information about the gstreamer-devel mailing list