diff options
author | Johan Dahlin <johan@gnome.org> | 2004-03-29 10:34:17 +0000 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2004-03-29 10:34:17 +0000 |
commit | 4a24e19c160535c7a65c7f3f11748e6048386038 (patch) | |
tree | 3511212fd7aa98805d4c8db512a4134035db3f0c | |
parent | 5811dfc3a6e6702866b4165e6c2d0137a21c1b72 (diff) |
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
-rw-r--r-- | examples/gst/wavenc.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/gst/wavenc.py b/examples/gst/wavenc.py index e40ec68e50..f75c064f60 100644 --- a/examples/gst/wavenc.py +++ b/examples/gst/wavenc.py @@ -4,14 +4,13 @@ import gst def decode(filename): output = filename + '.wav' - pipeline = ('filesrc location="%s" ! spider ! audio/x-raw-int,rate=44100,stereo=2 ! wavenc ! ' - 'filesink location="%s"') % (filename, output) + pipeline = ('{ filesrc location="%s" ! spider ! audio/x-raw-int,rate=44100,stereo=2 ! wavenc ! ' + 'filesink location="%s" }') % (filename, output) bin = gst.parse_launch(pipeline) bin.set_state(gst.STATE_PLAYING) - while bin.iterate(): - pass - bin.set_state(gst.STATE_NULL) + bin.connect('eos', lambda bin: gst.main_quit()) + gst.main() def main(args): for arg in args[1:]: |