summaryrefslogtreecommitdiff
path: root/includes/inc_session.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/inc_session.php')
-rwxr-xr-xincludes/inc_session.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/inc_session.php b/includes/inc_session.php
index 5c06c0c..95d01cb 100755
--- a/includes/inc_session.php
+++ b/includes/inc_session.php
@@ -4,8 +4,14 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category,
{
global $httppath, $ffmpegpath, $segmenterpath;
- // TODO: Get a session
- $session = session0;
+ // Get a free session
+ $i=0;
+ for ($i=0; $i<1000; $i++)
+ {
+ $session = "session" .$i;
+ if (!file_exists('ram/' .$session))
+ break;
+ }
// Create session
exec('mkdir ram/' .$session);
@@ -31,6 +37,12 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category,
// Write streaminfo
writeinfostream($session, $type, $name, $title, $desc, $qname, $category, $url, $mediapath, $subdir);
+ // Create logo
+ if ($type == 3)
+ generatelogo($type, $url, 'ram/' .$session .'/logo.png');
+ else
+ generatelogo($type, $name, 'ram/' .$session .'/logo.png');
+
// Copy status waiter
exec('cp streamstatus.php ram/' .$session);