diff -r 7f290a3a34b1 -r 0e159c5e2d32 gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py --- a/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Tue Aug 21 16:04:44 2007 +0100 +++ b/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Wed Aug 29 10:00:25 2007 +0100 @@ -72,15 +72,20 @@ try: self.proc = subprocess.Popen(self.opts, stdin=subprocess.PIPE, stdout=subprocess.PIPE) + + if outfile: + outfd.write("OK ") + except Exception, e: self.log.error(self.tid, "Error: executing GMencoder: %s" % e) outfd.write("Error: GMencoder: %s" % e) return False try: - p = select.poll() - #print outfd.fileno() - p.register (outfd, select.POLLNVAL | select.POLLERR | select.POLLHUP | select.POLLIN ) + if not outfile: + p = select.poll() + p.register (outfd, select.POLLNVAL | select.POLLERR | select.POLLHUP | select.POLLIN ) + while (self.proc and self.proc.poll() == None): r, w, x = select.select([self.proc.stdout], [], [], 1) if self.proc.stdout in r: @@ -90,11 +95,12 @@ elif (progress.find ("Erro") >= 0): return False - ret = p.poll(0) - if ret: - print "Lost Connection" - self.stop () - return False + if not outfile: + ret = p.poll(0) + if ret: + print "Lost Connection" + self.stop () + return False except Exception, e: self.log.error(self.tid, "Problems handling data: %s" % e) @@ -102,8 +108,6 @@ self.status = 100; - if outfile: - outfd.write("OK ") return True # start()