]> git.parisson.com Git - timeside.git/commitdiff
timeside/decoder/core.py: improve use of condition
authorPaul Brossier <piem@piem.org>
Mon, 28 Jan 2013 22:52:51 +0000 (17:52 -0500)
committerPaul Brossier <piem@piem.org>
Mon, 28 Jan 2013 22:52:51 +0000 (17:52 -0500)
timeside/decoder/core.py

index 725d6c17c6aaea516d913a4be46c6d7f6e013c66..669851da1802c56b6dbc8207999c877830f92ea1 100644 (file)
@@ -139,7 +139,7 @@ class FileDecoder(Processor):
         self.pipeline.set_state(gst.STATE_PLAYING)
 
         self.cond.acquire()
-        if not self.discovered:
+        while not self.discovered:
           #print 'waiting'
           self.cond.wait()
         self.cond.release()
@@ -202,8 +202,8 @@ class FileDecoder(Processor):
         elif t == gst.MESSAGE_ERROR:
             self.pipeline.set_state(gst.STATE_NULL)
             err, debug = message.parse_error()
-            self.discovered = True
             self.cond.acquire()
+            self.discovered = True
             self.cond.notify()
             self.cond.release()
             self.mainloop.quit()