Put it in a thread and run it in a mainloop

Original commit message from CVS:
Put it in a thread and run it in a mainloop
This commit is contained in:
Johan Dahlin 2004-03-29 10:34:17 +00:00
parent 5811dfc3a6
commit 4a24e19c16

View File

@ -4,14 +4,13 @@ import gst
def decode(filename): def decode(filename):
output = filename + '.wav' output = filename + '.wav'
pipeline = ('filesrc location="%s" ! spider ! audio/x-raw-int,rate=44100,stereo=2 ! wavenc ! ' pipeline = ('{ filesrc location="%s" ! spider ! audio/x-raw-int,rate=44100,stereo=2 ! wavenc ! '
'filesink location="%s"') % (filename, output) 'filesink location="%s" }') % (filename, output)
bin = gst.parse_launch(pipeline) bin = gst.parse_launch(pipeline)
bin.set_state(gst.STATE_PLAYING) bin.set_state(gst.STATE_PLAYING)
while bin.iterate(): bin.connect('eos', lambda bin: gst.main_quit())
pass gst.main()
bin.set_state(gst.STATE_NULL)
def main(args): def main(args):
for arg in args[1:]: for arg in args[1:]: