summaryrefslogtreecommitdiff
path: root/streamstatus.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-27 18:28:26 +0100
committerTheTroll <trolldev@gmail.com>2010-02-27 18:28:26 +0100
commita9e31e70ebf61264b548d7607a9621972eefe3ee (patch)
treec9b33bad04d3ea128d25b5efeeefd8c6431f021b /streamstatus.php
parent3497a84b220e1419e3642faa763fb2b5965675b0 (diff)
downloadistreamdev-a9e31e70ebf61264b548d7607a9621972eefe3ee.tar.gz
istreamdev-a9e31e70ebf61264b548d7607a9621972eefe3ee.tar.bz2
Check max encodings
Diffstat (limited to 'streamstatus.php')
-rwxr-xr-xstreamstatus.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/streamstatus.php b/streamstatus.php
index 15e2c39..baf515f 100755
--- a/streamstatus.php
+++ b/streamstatus.php
@@ -1,8 +1,21 @@
<?php
- header('Content-Type: text/xml');
- echo "<?xml version=\"1.0\"?>\n";
- echo "<status>\n";
+if (file_exists('config.php'))
+ include ('config.php');
+else
+ include ('config_default.php');
+
+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 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
+{
$cnt = 0;
while ( ( count(glob('*.ts')) < 2 ) && ( $cnt < 25 ) )
{
@@ -12,10 +25,11 @@
}
if ( count(glob('*.ts')) < 2 )
- echo "<streamstatus>error</streamstatus>\n";
- else
+ echo "<streamstatus>error</streamstatus><message>Error: encoding did not start correclty</message>\n";
+ else
echo "<streamstatus>ok</streamstatus>\n";
+}
- echo "</status>\n";
+echo "</status>\n";
?>