# HG changeset patch # User morphbr # Date 1178654463 -3600 # Node ID e3895362340582e1ff173fc1a2283ad479583a29 # Parent de71b8478b27682767a14b91fce71f47f6918582 [svn r644] * GMyth-Streamer: - bug fix on mencoder plugin - serve_version inside server.py diff -r de71b8478b27 -r e38953623405 gmyth-stream/server/0.2/lib/server.py --- a/gmyth-stream/server/0.2/lib/server.py Tue May 08 16:05:47 2007 +0100 +++ b/gmyth-stream/server/0.2/lib/server.py Tue May 08 21:01:03 2007 +0100 @@ -80,8 +80,9 @@ transcoders = utils.PluginSet(Transcoder) menu = { + "Stop": "/stop-transcoder.do", "Status": "/status.do", - "Stop": "/stop-transcoder.do", + "Version": "/version.do", "Shutdown": "/shutdown.do" } @@ -109,8 +110,8 @@ self.serve_stop_transcoder(body) elif self.path == "/status.do": self.serve_status(body) - elif self.path == "/play.do": - self.serve_play(body) + elif self.path == "/version.do": + self.serve_version(body) elif self.path == "/stream.do": self.serve_stream(body) else: @@ -153,6 +154,14 @@ self.wfile.write(utils.getHTML("index", {"menu": self._nav_items()})) # serve_main() + def serve_version(self, body): + self.send_response(200) + self.send_header("Content-Type", "text/html") + self.send_header('Connection', 'close') + self.end_headers() + if body: + self.wfile.write("Version: %s" % __version__) + def serve_shutdown(self, body): self.send_response(200) diff -r de71b8478b27 -r e38953623405 gmyth-stream/server/0.2/plugins/transcoders/mencoder.py --- a/gmyth-stream/server/0.2/plugins/transcoders/mencoder.py Tue May 08 16:05:47 2007 +0100 +++ b/gmyth-stream/server/0.2/plugins/transcoders/mencoder.py Tue May 08 21:01:03 2007 +0100 @@ -173,8 +173,13 @@ outfd.write("OK") # Configuring stdin - _stdin = open(self.args["input"]) - size = int(os.path.getsize(self.args["input"])) + try: + _stdin = open(self.args["input"]) + size = int(os.path.getsize(self.args["input"])) + except Exception, e: + self.log.error("Mencoder stdin setup error: %s" % e) + return False + self.status = 0 total_read = 0