diff options
Diffstat (limited to 'streamstatus.php')
-rwxr-xr-x | streamstatus.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/streamstatus.php b/streamstatus.php index 38e20c9..54823be 100755 --- a/streamstatus.php +++ b/streamstatus.php @@ -5,26 +5,30 @@ if (file_exists('config.php')) else include ('config_default.php'); +global $maxencodingprocesses; + header('Content-Type: text/xml'); echo "<?xml version=\"1.0\"?>\n"; echo "<status>\n"; // First check that we are allowed to create a new encoding process -$nbencprocess = exec("find .. -name segmenter.pid | wc | awk '{ print $1 }'"); +$nbencprocess = exec("find -name segmenter.pid | wc | awk '{ print $1 }'"); if ($nbencprocess > $maxencodingprocesses) echo "<streamstatus>error</streamstatus><message>Error: maximun number of sessions reached</message>\n"; else { + $session = $_REQUEST['session']; + $cnt = 0; - while ( ( count(glob('*.ts')) < 2 ) && ( $cnt < 25 ) ) + while ( ( count(glob('ram/' .$session '/*.ts')) < 2 ) && ( $cnt < 25 ) ) { // wait for stream available sleep(1); $cnt++; } - if ( count(glob('*.ts')) < 2 ) + if ( count(glob('ram/' .$session '/*.ts')) < 2 ) echo "<streamstatus>error</streamstatus><message>Error: encoding did not start correclty</message>\n"; else echo "<streamstatus>ok</streamstatus>\n"; |