diff -r 27e83a8f68d7 -r 00a5cf92ec21 gmyth-stream/tests/client_ffmpeg.py --- a/gmyth-stream/tests/client_ffmpeg.py Tue Apr 03 16:42:04 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -import os -import sys -import time -import socket - - -if len(sys.argv) < 2: - HOST = 'localhost' - PORT = 5000 -elif len(sys.argv) == 2: - HOST = sys.argv[1] - PORT = 5000 -else: - HOST = sys.argv[1] - PORT = int(sys.argv[2]) - -socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) -socket.settimeout(10) - -try: - socket.connect( (HOST,PORT) ) -except: - print "\n--> Could not connect to ('%s':'%d')\n" % (HOST,PORT) - sys.exit(-1) - - -mplayer = os.popen("which mplayer").read().strip() -mplayer += " - 1> /dev/null" -pin, pout = os.popen2(mplayer) - -data = socket.recv(1024) -i = 0 - -while (data != ""): - pin.write(data) - data = socket.recv(1024) - if (i == 500): - socket.send("OK") - i += 1 - -pin.close() -socket.close() - - -# from select import select -# r, w, x = select([pout], []. [], 0) -# if pout in r: -# pout.read(32)