summaryrefslogtreecommitdiff
path: root/bin/session.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-04-01 14:56:15 +0200
committerTheTroll <trolldev@gmail.com>2010-04-01 14:56:15 +0200
commitf71315d724f52551980f50b446697fe6130fc451 (patch)
tree9babb5d135e8b34988b8914b7c84f00ce2079136 /bin/session.php
parent67957d8306d4975fc0bc87966abcbc47cb38a846 (diff)
downloadistreamdev-f71315d724f52551980f50b446697fe6130fc451.tar.gz
istreamdev-f71315d724f52551980f50b446697fe6130fc451.tar.bz2
Change the way we start/kill sessions
No need for a modified version of segmenter anymore
Diffstat (limited to 'bin/session.php')
-rw-r--r--bin/session.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/session.php b/bin/session.php
index 950c855..2d63f4e 100644
--- a/bin/session.php
+++ b/bin/session.php
@@ -82,13 +82,13 @@ function sessioncreate($type, $url, $mode)
switch ($type)
{
case 'tv':
- $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh \\\"" .$url ."\\\" " .$qparams ." " .$httppath ." 2 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \\\"" .$ffdbg ."\\\" \" | at now";
+ $cmd = "./istream.sh \"" .$url ."\" " .$qparams ." " .$httppath ." 2 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" >/dev/null &";
break;
case 'rec':
- $cmd = "export SHELL=\"/bin/sh\";printf \"cat \\\"" .$url ."\\\"/0* | ./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \\\"" .$ffdbg ."\\\" \" | at now";
+ $cmd = "cat \"" .$url ."\"/0* | ./istream.sh - " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" >/dev/null &";
break;
case 'vid':
- $cmd = "export SHELL=\"/bin/sh\";printf \"./istream.sh \\\"" .$url ."\\\" " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \\\"" .$ffdbg ."\\\" \" | at now";
+ $cmd = "./istream.sh \"" .$url ."\" " .$qparams ." " .$httppath ." 1260 " .$ffmpegpath ." " .$segmenterpath ." " .$session ." \"" .$ffdbg ."\" >/dev/null &";
break;
default:
$cmd = "";
@@ -194,10 +194,15 @@ function sessiondeletesingle($session)
addlog("Deleting session " .$session);
$ram = "../ram/" .$session ."/";
+ $cmd = "";
- // Get segmenter PID if any
+ // First kill ffmpeg
+ if (file_exists($ram ."ffmpeg.pid"))
+ $cmd .= " kill `cat " .$ram ."ffmpeg.pid`; rm " .$ram ."ffmpeg.pid; ";
+
+ // Then kill segmenter
if (file_exists($ram ."segmenter.pid"))
- $cmd = "/usr/local/bin/fw;kill `cat " .$ram ."segmenter.pid`; rm " .$ram ."segmenter.pid; ";
+ $cmd .= " kill `cat " .$ram ."segmenter.pid`; rm " .$ram ."segmenter.pid; ";
addlog("Sending session kill command: " .$cmd);