# HG changeset patch
# User morphbr
# Date 1180624187 -3600
# Node ID 6431b16e18fb799e9496cbf5fce7e294c38a237f
# Parent  a102805611e7aceb3c39bcbaa1fa74e4f8c2b6eb
[svn r732] * GMyth-Streamer
		- bug fixes

diff -r a102805611e7 -r 6431b16e18fb gmyth-stream/server/0.3/lib/file_handler.py
--- a/gmyth-stream/server/0.3/lib/file_handler.py	Thu May 31 16:02:53 2007 +0100
+++ b/gmyth-stream/server/0.3/lib/file_handler.py	Thu May 31 16:09:47 2007 +0100
@@ -19,15 +19,17 @@
     opts = {}
 
     def __init__(self, filename, args):
-        print filename
         if filename == "" or not os.path.exists(filename):
             self.opts = args.copy()
-            self.opts["original"] = self.opts.pop("input", "").split("://")[1]
-            self.opts["original_mtime"] = os.stat(
-                self.opts["original"])[ST_MTIME]
 
-            name = os.path.splitext(os.path.basename(self.opts["outfile"]))[0]
-            output = open(".transcoded/%s.dat" % name, "wb")
+            if self.opts["type"][0] != "myth":
+                self.opts["original_mtime"] = os.stat(
+                    self.opts["uri"][0])[ST_MTIME]
+
+            name = os.path.basename(self.opts["uri"][0])
+            self.opts["original"] = name
+            output = open(".transcoded/%s.dat" % \
+                          os.path.basename(self.opts["outfile"][0]), "wb")
             # dumps data using the highest protocol
             pickle.dump(self.opts, output, -1)
             output.close()
diff -r a102805611e7 -r 6431b16e18fb gmyth-stream/server/0.3/lib/request_handler.py
--- a/gmyth-stream/server/0.3/lib/request_handler.py	Thu May 31 16:02:53 2007 +0100
+++ b/gmyth-stream/server/0.3/lib/request_handler.py	Thu May 31 16:09:47 2007 +0100
@@ -337,6 +337,7 @@
                 self.server.add_transcoders(self, obj)
                 obj.start(self.wfile)
                 self.server.del_transcoders(self, obj)
+                files.TranscodedFile("", self.query)
 
             elif self.query.get("type", "")[0] == "file" and \
                      self.query.get("uri", None):
diff -r a102805611e7 -r 6431b16e18fb gmyth-stream/server/0.3/plugins/transcoders/mencoder.py
--- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Thu May 31 16:02:53 2007 +0100
+++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Thu May 31 16:09:47 2007 +0100
@@ -14,7 +14,6 @@
 
 import lib.utils as utils
 import lib.server as server
-import lib.file_handler as files
 import plugins.transcoders.mencoder_lib.mythtv as mythtv
 
 from select import select
@@ -205,6 +204,8 @@
 
         stdout = self._check_opened_file(stdw, _stdin)
 
+        outfd.write("OK   ")
+
         try:
             while self.proc and self.proc.poll() == None:
                 if not finished:
@@ -227,7 +228,6 @@
             self.stop()
             return False
 
-        files.TranscodedFile("", self.args)
         self.log.info(self.tid, "OK: Done")
         return True
     # _start_outfile()