[svn r644] * GMyth-Streamer: trunk
authormorphbr
Tue May 08 21:01:03 2007 +0100 (2007-05-08)
branchtrunk
changeset 638e38953623405
parent 637 de71b8478b27
child 639 b2ebfaeb18c1
[svn r644] * GMyth-Streamer:
- bug fix on mencoder plugin
- serve_version inside server.py
gmyth-stream/server/0.2/lib/server.py
gmyth-stream/server/0.2/plugins/transcoders/mencoder.py
     1.1 --- a/gmyth-stream/server/0.2/lib/server.py	Tue May 08 16:05:47 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.2/lib/server.py	Tue May 08 21:01:03 2007 +0100
     1.3 @@ -80,8 +80,9 @@
     1.4      transcoders = utils.PluginSet(Transcoder)
     1.5  
     1.6      menu = {
     1.7 +        "Stop": "/stop-transcoder.do",
     1.8          "Status": "/status.do",
     1.9 -        "Stop": "/stop-transcoder.do",
    1.10 +        "Version": "/version.do",
    1.11          "Shutdown": "/shutdown.do"
    1.12          }
    1.13  
    1.14 @@ -109,8 +110,8 @@
    1.15              self.serve_stop_transcoder(body)
    1.16          elif self.path == "/status.do":
    1.17              self.serve_status(body)
    1.18 -        elif self.path == "/play.do":
    1.19 -            self.serve_play(body)
    1.20 +        elif self.path == "/version.do":
    1.21 +            self.serve_version(body)
    1.22          elif self.path == "/stream.do":
    1.23              self.serve_stream(body)
    1.24          else:
    1.25 @@ -153,6 +154,14 @@
    1.26              self.wfile.write(utils.getHTML("index", {"menu": self._nav_items()}))
    1.27      # serve_main()
    1.28  
    1.29 +    def serve_version(self, body):
    1.30 +        self.send_response(200)
    1.31 +        self.send_header("Content-Type", "text/html")
    1.32 +        self.send_header('Connection', 'close')
    1.33 +        self.end_headers()
    1.34 +        if body:
    1.35 +            self.wfile.write("Version: %s" %  __version__)
    1.36 +
    1.37  
    1.38      def serve_shutdown(self, body):
    1.39          self.send_response(200)
     2.1 --- a/gmyth-stream/server/0.2/plugins/transcoders/mencoder.py	Tue May 08 16:05:47 2007 +0100
     2.2 +++ b/gmyth-stream/server/0.2/plugins/transcoders/mencoder.py	Tue May 08 21:01:03 2007 +0100
     2.3 @@ -173,8 +173,13 @@
     2.4          outfd.write("OK")
     2.5  
     2.6          # Configuring stdin
     2.7 -        _stdin = open(self.args["input"])
     2.8 -        size = int(os.path.getsize(self.args["input"]))
     2.9 +        try:
    2.10 +            _stdin = open(self.args["input"])
    2.11 +            size = int(os.path.getsize(self.args["input"]))
    2.12 +        except Exception, e:
    2.13 +            self.log.error("Mencoder stdin setup error: %s" % e)
    2.14 +            return False
    2.15 +
    2.16          self.status = 0
    2.17          total_read = 0
    2.18