# HG changeset patch # User morphbr # Date 1180956607 -3600 # Node ID fe8ddffd7f5c7ffe88f2fd7dcbb86a649940b317 # Parent ffc7212656a5f69f7707edb52d64b31c122923de [svn r748] * GMyth-Streamer - Mencoder multicast and unicast bug fix; - Fixed bug when trying to just stream (not transcode) a file that does not exist. diff -r ffc7212656a5 -r fe8ddffd7f5c gmyth-stream/server/0.3/lib/request_handler.py --- a/gmyth-stream/server/0.3/lib/request_handler.py Fri Jun 01 19:41:45 2007 +0100 +++ b/gmyth-stream/server/0.3/lib/request_handler.py Mon Jun 04 12:30:07 2007 +0100 @@ -325,7 +325,6 @@ obj = transcoder(self.query) except Exception, e: self.send_error(500, str(e)) - print "teste2" return self.send_response(200) @@ -334,6 +333,7 @@ self.end_headers() if body: + if self.query.get("transcoder", None): test_tid = int(self.query.get("tid", "0")[0]) if test_tid == 0 or test_tid not in self.tid_queue: @@ -350,8 +350,11 @@ elif self.query.get("type", "")[0] == "file" and \ self.query.get("uri", None): - media = open(self.query.get("uri", None)[0]) - self.wfile.write(media.read()) + try: + media = open(self.query.get("uri", None)[0]) + self.wfile.write(media.read()) + except Exception: + self.log.error("Stream error: %s" %e) # serve_stream() diff -r ffc7212656a5 -r fe8ddffd7f5c gmyth-stream/server/0.3/plugins/transcoders/mencoder.py --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py Fri Jun 01 19:41:45 2007 +0100 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py Mon Jun 04 12:30:07 2007 +0100 @@ -185,7 +185,10 @@ self._setup_filename() self._setup_mencoder_opts(self.mencoder_opts) except Exception, e: - self.log.error(self.tid, "Error: %s" % e) + if self.log: + self.log.error(self.tid, "Error: %s" % e) + else: + raise # __init__() @@ -257,7 +260,7 @@ if not self._run_mencoder(output=subprocess.PIPE): return False - if not self.params_first("multicast", None): + if not self.params_first("multicast", False): try: while self.proc and self.proc.poll() == None: d = self.proc.stdout.read(1024)