diff options
author | TheTroll <trolldev@gmail.com> | 2010-02-27 19:01:05 +0100 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-02-27 19:01:05 +0100 |
commit | ba0c6b5de1803eb14af25647322d0f0996ac6902 (patch) | |
tree | ebb20bf34bbaf26af5ffcdad2775662e58042c53 /streamstatus.php | |
parent | fea360ceb0c1222e0691bf825c76fce25b8495ef (diff) | |
download | istreamdev-ba0c6b5de1803eb14af25647322d0f0996ac6902.tar.gz istreamdev-ba0c6b5de1803eb14af25647322d0f0996ac6902.tar.bz2 |
WIP
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"; |