|
From: <me...@us...> - 2007-08-23 21:30:54
|
Revision: 831
http://gmyth.svn.sourceforge.net/gmyth/?rev=831&view=rev
Author: melunko
Date: 2007-08-23 14:30:57 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
fixed bug on transcode file
Modified Paths:
--------------
trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py
Modified: trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py
===================================================================
--- trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py 2007-08-23 19:24:11 UTC (rev 830)
+++ trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py 2007-08-23 21:30:57 UTC (rev 831)
@@ -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()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|