summaryrefslogtreecommitdiff
path: root/includes/include.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-26 16:31:24 +0100
committerTheTroll <trolldev@gmail.com>2010-02-26 16:31:24 +0100
commitc904edb8d3cb6f03942ba9a65ee7f0ef5646493c (patch)
tree2ef911a28a7532e67fae2b1ac2776c9df5bc6b84 /includes/include.php
parent39c1ca8f367d9fa60ab02542abcdc2b7dee5b556 (diff)
downloadistreamdev-c904edb8d3cb6f03942ba9a65ee7f0ef5646493c.tar.gz
istreamdev-c904edb8d3cb6f03942ba9a65ee7f0ef5646493c.tar.bz2
Now kill segmenter using its PID
Diffstat (limited to 'includes/include.php')
-rwxr-xr-xincludes/include.php17
1 files changed, 15 insertions, 2 deletions
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);