summaryrefslogtreecommitdiff
path: root/streamstatus.php
blob: 4582dc604722a3858511a3c69c31e20a755a0c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
	header('Content-Type: text/xml'); 
	echo "<?xml version=\"1.0\"?>\n";
	echo "<status>\n";
	$cnt = 0;

	while ( ( count(glob('ram/*.ts')) < 2 ) && ( $cnt < 25 ) )
	{
		// wait for stream available
		sleep(1);
		$cnt++;
	}

	if ( count(glob('ram/*.ts')) < 2 )
		echo "<streamstatus>error</streamstatus>\n";
        else
		echo "<streamstatus>ok</streamstatus>\n";

	echo "</status>\n";

?>