gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py
branchtrunk
changeset 807 add4025ca678
parent 803 b1d0964060b3
child 809 ec0a31edf362
     1.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py	Wed Aug 15 13:33:12 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py	Thu Aug 16 14:46:11 2007 +0100
     1.3 @@ -13,6 +13,7 @@
     1.4  import time
     1.5  
     1.6  import select
     1.7 +import fcntl
     1.8  
     1.9  import lib.utils as utils
    1.10  import lib.server as server
    1.11 @@ -76,12 +77,27 @@
    1.12              return False
    1.13  
    1.14          try:
    1.15 +	    #p = select.poll()
    1.16 +	    #print outfd.fileno()
    1.17 +	    #p.register (connection, select.POLLNVAL | select.POLLERR | select.POLLHUP)
    1.18              while (self.proc and self.proc.poll() == None):
    1.19 -                r, w, x = select.select([self.proc.stdout], [], [], 0)
    1.20 +                r, w, x = select.select([self.proc.stdout], [], [], 1)
    1.21                  if self.proc.stdout in r:
    1.22                      progress = self.proc.stdout.readline()
    1.23                      if (progress.find ("PROGRESS") >= 0):
    1.24                          self.status = progress.split (":")[1]
    1.25 +		    elif (progress.find ("Erro") >= 0):
    1.26 +			return False
    1.27 +		"""
    1.28 +		try:
    1.29 +		    print connection.getpeername()
    1.30 +		    print connection.getsockname()
    1.31 +		except Esception, e:
    1.32 +		    print "Lost Connection"
    1.33 +		    self.stop ()
    1.34 +		    return False
    1.35 +		"""
    1.36 +
    1.37          except Exception, e:
    1.38              self.log.error(self.tid, "Problems handling data: %s" % e)
    1.39              return False