[svn r732] * GMyth-Streamer trunk
authormorphbr
Thu May 31 16:09:47 2007 +0100 (2007-05-31)
branchtrunk
changeset 7266431b16e18fb
parent 725 a102805611e7
child 727 72f9152d4e2a
[svn r732] * GMyth-Streamer
- bug fixes
gmyth-stream/server/0.3/lib/file_handler.py
gmyth-stream/server/0.3/lib/request_handler.py
gmyth-stream/server/0.3/plugins/transcoders/mencoder.py
     1.1 --- a/gmyth-stream/server/0.3/lib/file_handler.py	Thu May 31 16:02:53 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/lib/file_handler.py	Thu May 31 16:09:47 2007 +0100
     1.3 @@ -19,15 +19,17 @@
     1.4      opts = {}
     1.5  
     1.6      def __init__(self, filename, args):
     1.7 -        print filename
     1.8          if filename == "" or not os.path.exists(filename):
     1.9              self.opts = args.copy()
    1.10 -            self.opts["original"] = self.opts.pop("input", "").split("://")[1]
    1.11 -            self.opts["original_mtime"] = os.stat(
    1.12 -                self.opts["original"])[ST_MTIME]
    1.13  
    1.14 -            name = os.path.splitext(os.path.basename(self.opts["outfile"]))[0]
    1.15 -            output = open(".transcoded/%s.dat" % name, "wb")
    1.16 +            if self.opts["type"][0] != "myth":
    1.17 +                self.opts["original_mtime"] = os.stat(
    1.18 +                    self.opts["uri"][0])[ST_MTIME]
    1.19 +
    1.20 +            name = os.path.basename(self.opts["uri"][0])
    1.21 +            self.opts["original"] = name
    1.22 +            output = open(".transcoded/%s.dat" % \
    1.23 +                          os.path.basename(self.opts["outfile"][0]), "wb")
    1.24              # dumps data using the highest protocol
    1.25              pickle.dump(self.opts, output, -1)
    1.26              output.close()
     2.1 --- a/gmyth-stream/server/0.3/lib/request_handler.py	Thu May 31 16:02:53 2007 +0100
     2.2 +++ b/gmyth-stream/server/0.3/lib/request_handler.py	Thu May 31 16:09:47 2007 +0100
     2.3 @@ -337,6 +337,7 @@
     2.4                  self.server.add_transcoders(self, obj)
     2.5                  obj.start(self.wfile)
     2.6                  self.server.del_transcoders(self, obj)
     2.7 +                files.TranscodedFile("", self.query)
     2.8  
     2.9              elif self.query.get("type", "")[0] == "file" and \
    2.10                       self.query.get("uri", None):
     3.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Thu May 31 16:02:53 2007 +0100
     3.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Thu May 31 16:09:47 2007 +0100
     3.3 @@ -14,7 +14,6 @@
     3.4  
     3.5  import lib.utils as utils
     3.6  import lib.server as server
     3.7 -import lib.file_handler as files
     3.8  import plugins.transcoders.mencoder_lib.mythtv as mythtv
     3.9  
    3.10  from select import select
    3.11 @@ -205,6 +204,8 @@
    3.12  
    3.13          stdout = self._check_opened_file(stdw, _stdin)
    3.14  
    3.15 +        outfd.write("OK   ")
    3.16 +
    3.17          try:
    3.18              while self.proc and self.proc.poll() == None:
    3.19                  if not finished:
    3.20 @@ -227,7 +228,6 @@
    3.21              self.stop()
    3.22              return False
    3.23  
    3.24 -        files.TranscodedFile("", self.args)
    3.25          self.log.info(self.tid, "OK: Done")
    3.26          return True
    3.27      # _start_outfile()