gmyth-stream/server/0.3/lib/request_handler.py
branchtrunk
changeset 809 ec0a31edf362
parent 802 d0e8c542c38e
child 815 7f290a3a34b1
     1.1 --- a/gmyth-stream/server/0.3/lib/request_handler.py	Mon Aug 13 23:03:08 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/lib/request_handler.py	Thu Aug 16 15:48:57 2007 +0100
     1.3 @@ -362,7 +362,8 @@
     1.4              return
     1.5  
     1.6          #Only stream files on .transcode dir
     1.7 -        filename = ".transcode/" + os.path.basename(filename)
     1.8 +        filename = ".transcoded/" + os.path.basename(filename)
     1.9 +        self.log.error("Stream file: %s" % filename)
    1.10          if not os.path.exists (filename):
    1.11              self.send_error(404, "File not found")
    1.12              return
    1.13 @@ -386,13 +387,16 @@
    1.14          self.transcoders_log.insert(test_tid, "gms.Stream: %s" % filename)
    1.15  
    1.16          try:
    1.17 +            file_data = ""
    1.18              while data_in != "":
    1.19                  data_in = media.read(4096)
    1.20 -                total_read += 4096
    1.21 -                self.wfile.write(data_in)
    1.22 -                status = utils.progress_bar(total_read, size, 50)
    1.23 -                msg_status = "Status:%s:%s%%" % (test_tid, status)
    1.24 -                self.transcoders_log._update_status(test_tid, msg_status)
    1.25 +                file_data += data_in
    1.26 +
    1.27 +                #total_read += 4096
    1.28 +            self.wfile.write(file_data)
    1.29 +                #status = utils.progress_bar(total_read, size, 50)
    1.30 +                #msg_status = "Status:%s:%s%%" % (test_tid, status)
    1.31 +                #self.transcoders_log._update_status(test_tid, msg_status)
    1.32  
    1.33              self.transcoders_log._update_status(test_tid, "OK: Done")
    1.34  
    1.35 @@ -435,7 +439,11 @@
    1.36                  obj.log = self.transcoders_log
    1.37  
    1.38                  self.server.add_transcoders(self, obj)
    1.39 -                obj.start(self.wfile)
    1.40 +                if obj.start(self.wfile):
    1.41 +                    self.transcoders_log.info (test_tid, "OK")
    1.42 +                else:
    1.43 +                    self.transcoders_log.info (test_tid, "Fail")
    1.44 +
    1.45                  self.server.del_transcoders(self, obj)
    1.46                  files.TranscodedFile("", self.query)
    1.47