From c904edb8d3cb6f03942ba9a65ee7f0ef5646493c Mon Sep 17 00:00:00 2001 From: TheTroll Date: Fri, 26 Feb 2010 16:31:24 +0100 Subject: Now kill segmenter using its PID --- includes/include.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'includes/include.php') diff --git a/includes/include.php b/includes/include.php index 8045ab1..38a91b8 100755 --- a/includes/include.php +++ b/includes/include.php @@ -17,7 +17,20 @@ function selectpage() if ($action == "stopstream") { - $cmd= "killall segmenter && killall -9 ffmpeg ; rm ram/stream*"; + $subcmd = ""; + + // Get segmenter PID + $pidfile = fopen('ram/streamsegmenterpid', 'r'); + if ($pidfile) + { + $pid = fgets($pidfile); + $pid = substr($pid, 0, -1); + $subcmd = "kill " .$pid ." ; "; + fclose($pidfile); + } + + $cmd= $subcmd ."rm ram/stream*"; + print $cmd; exec ($cmd); $action = $_REQUEST['actionafterstop']; @@ -115,7 +128,7 @@ function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, } $cmd = str_replace('%', '%%', $cmd); - exec ($cmd); + exec($cmd); // Write streaminfo writeinfostream($type, $name, $title, $desc, $qname, $category, $url, $mediapath, $subdir); -- cgit v1.2.3