gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py
branchtrunk
changeset 804 4b2192319f56
parent 800 2b1824e138b1
child 806 d35b50f4d77e
     1.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py	Mon Aug 13 22:29:00 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py	Wed Aug 15 20:52:44 2007 +0100
     1.3 @@ -34,17 +34,6 @@
     1.4          self.opts.append ("-d")
     1.5          self._parser_params ()
     1.6  
     1.7 -        outfile = self.params_first("outfile", "")
     1.8 -
     1.9 -        if outfile != "":
    1.10 -            path = os.path.join(sys.path[0], ".transcoded", outfile)
    1.11 -            self._insert_param("-o", "file://%s" % path)
    1.12 -        else:
    1.13 -            self._insert_param ("-o", "fd://%d" % outfd.fileno())
    1.14 -            self.opts.append ("-c")
    1.15 -
    1.16 -        cmd = " ".join(self.opts)
    1.17 -
    1.18      # __init__()
    1.19  
    1.20      def _insert_param (self, name, value):
    1.21 @@ -66,6 +55,16 @@
    1.22      # _parse_params
    1.23  
    1.24      def start(self, outfd):
    1.25 +        outfile = self.params_first("outfile", "")
    1.26 +
    1.27 +        if outfile != "":
    1.28 +            path = os.path.join(sys.path[0], ".transcoded", outfile)
    1.29 +            self._insert_param("-o", "file://%s" % path)
    1.30 +        else:
    1.31 +            self._insert_param ("-o", "fd://%d" % outfd.fileno())
    1.32 +            self.opts.append ("-c")
    1.33 +
    1.34 +        cmd = " ".join(self.opts)
    1.35          self.log.info(self.tid, "GMencoder: %s" % cmd)
    1.36  
    1.37          try:
    1.38 @@ -88,6 +87,10 @@
    1.39              return False
    1.40  
    1.41          self.status = 100;
    1.42 +
    1.43 +        if outfile:
    1.44 +           outfd.write("OK   ")
    1.45 +
    1.46          return True
    1.47      # start()
    1.48