diff options
author | TheTroll <trolldev@gmail.com> | 2010-02-27 19:55:26 +0100 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-02-27 19:55:26 +0100 |
commit | e3111d568164aa1f0d3bd303e3b80dcb6f375047 (patch) | |
tree | 44d4500a26c7109472cc150bf906501b8d86712b | |
parent | 412e440c178726a642657d007ed0eb95f7961dee (diff) | |
download | istreamdev-e3111d568164aa1f0d3bd303e3b80dcb6f375047.tar.gz istreamdev-e3111d568164aa1f0d3bd303e3b80dcb6f375047.tar.bz2 |
Fixed status
-rwxr-xr-x | streamstatus.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/streamstatus.php b/streamstatus.php index cbcf396..dc05bc3 100755 --- a/streamstatus.php +++ b/streamstatus.php @@ -12,14 +12,22 @@ echo "<?xml version=\"1.0\"?>\n"; echo "<status>\n"; +$session = $_REQUEST['session']; + +exec('echo ' .$session .' >/tmp/aa'); + // First check that we are allowed to create a new encoding process -$nbencprocess = exec("find ram/ -name segmenter.pid | wc | awk '{ print $1 }'"); -if ($nbencprocess >= $maxencodingprocesses) - echo "<streamstatus>error</streamstatus><message>Error: maximun number of sessions reached</message>\n"; -else +if (($session == "") || !count(glob('ram/' .$session))) { - $session = $_REQUEST['session']; + $nbencprocess = exec("find ram/ -name segmenter.pid | wc | awk '{ print $1 }'"); + if ($nbencprocess >= $maxencodingprocesses) + echo "<streamstatus>error</streamstatus><message>Error: maximun number of sessions reached</message>\n"; + else + echo "<streamstatus>error</streamstatus><message>Error: cannot create session</message>\n"; +} +else +{ $cnt = 0; while ( ( count(glob('ram/' .$session . '/*.ts')) < 2 ) && ( $cnt < 25 ) ) { |