From a9e31e70ebf61264b548d7607a9621972eefe3ee Mon Sep 17 00:00:00 2001 From: TheTroll Date: Sat, 27 Feb 2010 18:28:26 +0100 Subject: Check max encodings --- streamstatus.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'streamstatus.php') diff --git a/streamstatus.php b/streamstatus.php index 15e2c39..baf515f 100755 --- a/streamstatus.php +++ b/streamstatus.php @@ -1,8 +1,21 @@ \n"; - echo "\n"; +if (file_exists('config.php')) + include ('config.php'); +else + include ('config_default.php'); + +header('Content-Type: text/xml'); +echo "\n"; + +echo "\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 "errorError: maximun number of sessions reached\n"; +else +{ $cnt = 0; while ( ( count(glob('*.ts')) < 2 ) && ( $cnt < 25 ) ) { @@ -12,10 +25,11 @@ } if ( count(glob('*.ts')) < 2 ) - echo "error\n"; - else + echo "errorError: encoding did not start correclty\n"; + else echo "ok\n"; +} - echo "\n"; +echo "\n"; ?> -- cgit v1.2.3