[svn r748] * GMyth-Streamer trunk
authormorphbr
Mon Jun 04 12:30:07 2007 +0100 (2007-06-04)
branchtrunk
changeset 742fe8ddffd7f5c
parent 741 ffc7212656a5
child 743 f92cd43fea7d
[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.
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/request_handler.py	Fri Jun 01 19:41:45 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/lib/request_handler.py	Mon Jun 04 12:30:07 2007 +0100
     1.3 @@ -325,7 +325,6 @@
     1.4              obj = transcoder(self.query)
     1.5          except Exception, e:
     1.6              self.send_error(500, str(e))
     1.7 -            print "teste2"
     1.8              return
     1.9  
    1.10          self.send_response(200)
    1.11 @@ -334,6 +333,7 @@
    1.12          self.end_headers()
    1.13  
    1.14          if body:
    1.15 +
    1.16              if self.query.get("transcoder", None):
    1.17                  test_tid = int(self.query.get("tid", "0")[0])
    1.18                  if test_tid == 0 or test_tid not in self.tid_queue:
    1.19 @@ -350,8 +350,11 @@
    1.20  
    1.21              elif self.query.get("type", "")[0] == "file" and \
    1.22                       self.query.get("uri", None):
    1.23 -                media = open(self.query.get("uri", None)[0])
    1.24 -                self.wfile.write(media.read())
    1.25 +                try:
    1.26 +                    media = open(self.query.get("uri", None)[0])
    1.27 +                    self.wfile.write(media.read())
    1.28 +                except Exception:
    1.29 +                    self.log.error("Stream error: %s" %e)
    1.30      # serve_stream()
    1.31  
    1.32  
     2.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Fri Jun 01 19:41:45 2007 +0100
     2.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Mon Jun 04 12:30:07 2007 +0100
     2.3 @@ -185,7 +185,10 @@
     2.4              self._setup_filename()
     2.5              self._setup_mencoder_opts(self.mencoder_opts)
     2.6          except Exception, e:
     2.7 -            self.log.error(self.tid, "Error: %s" % e)
     2.8 +            if self.log:
     2.9 +                self.log.error(self.tid, "Error: %s" % e)
    2.10 +            else:
    2.11 +                raise
    2.12      # __init__()
    2.13  
    2.14  
    2.15 @@ -257,7 +260,7 @@
    2.16          if not self._run_mencoder(output=subprocess.PIPE):
    2.17              return False
    2.18  
    2.19 -        if not self.params_first("multicast", None):
    2.20 +        if not self.params_first("multicast", False):
    2.21              try:
    2.22                  while self.proc and self.proc.poll() == None:
    2.23                      d = self.proc.stdout.read(1024)