summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlib <aliboba@free.fr>2010-02-27 18:28:55 +0100
committerAlib <aliboba@free.fr>2010-02-27 18:28:55 +0100
commit60bda4c150c981432102022177c3b391043817f3 (patch)
treeaa717a9f5d3d72e0feba7dd5104023f5ae217de9
parent2429b586aeeb9d7eb7e77bdd932ce76e364bc8c5 (diff)
parenta9e31e70ebf61264b548d7607a9621972eefe3ee (diff)
downloadistreamdev-60bda4c150c981432102022177c3b391043817f3.tar.gz
istreamdev-60bda4c150c981432102022177c3b391043817f3.tar.bz2
Merge branch 'master' of projects.vdr-developer.org:istreamdev
-rwxr-xr-xconfig_default.php1
-rwxr-xr-xstreamstatus.php26
2 files changed, 21 insertions, 6 deletions
diff --git a/config_default.php b/config_default.php
index 3a2dba0..3733e12 100755
--- a/config_default.php
+++ b/config_default.php
@@ -25,6 +25,7 @@
$quality=array ( 'Edge' => '128k 64k 1 240x160',
'3g' => '350k 64k 1 408x272',
'Wifi' => '512k 128k 2 480x320');
+ $maxencodingprocesses=10; // Max simultaneous encoding processes
// Misc
$ffmpegpath = '/usr/bin/ffmpeg'; //path to ffmpeg binary
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";
?>