aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Toad King <toadking@toadking.com>2012-09-17 20:20:08 -0400
committerGravatar Toad King <toadking@toadking.com>2012-09-17 20:20:08 -0400
commit9435783e7978cfa463d0d723ad9b276ec3eccf3a (patch)
treea3cf0086da7914013eabfd73288a8e46c9d70629
parentb62623e0cbf6afae371137fbe2354f936bcbab99 (diff)
named pipe fixes
-rw-r--r--src/livestreamer/cli.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py
index 811cb2a..4177919 100644
--- a/src/livestreamer/cli.py
+++ b/src/livestreamer/cli.py
@@ -134,7 +134,7 @@ def write_stream(fd, out, progress, player):
logger.info("Stream ended")
- if is_win32:
+ if is_win32 and type(out) is not file:
from ctypes import *
windll.kernel32.DisconnectNamedPipe(out)
elif out != stdout:
@@ -243,10 +243,8 @@ def output_stream(stream, args):
perr = sys.stdout
logger.info("Starting player: {0}", args.player)
-
player = subprocess.Popen(cmd, shell=True, stdout=pout, stderr=perr,
stdin=pin)
-
if not args.fifo:
out = player.stdin
@@ -258,7 +256,6 @@ def output_stream(stream, args):
msvcrt.setmode(out.fileno(), os.O_BINARY)
logger.debug("Writing stream to output")
-
do_write(out, prebuffer)
try:
@@ -275,10 +272,8 @@ def output_stream(stream, args):
if args.fifo and not args.output and not args.stdout:
if is_win32:
from ctypes import windll
- windll.kernel32.DisconnectNamedPipe(out)
windll.kernel32.CloseHandle(out)
else:
- out.close()
os.unlink(pipename)
def handle_url(args):