function getStreamInfo($streamData) { global $config, $db; if ($config['httpStreaming']) { // no stream info... return; } elseif ($config['tamburineURL']) { $rpc = new rpc_Utils(); //$rpc->debug = true; $response = $rpc->callTamburine('getpls', $streamData['pid']); if (is_null($response)) { logError("no reply from tamburine server"); } else { $offset = $response[2]; $filename = $response[2 + $offset]; //debug("response", $response); //debug("fname", $filename); } } elseif ($config['tamburineCMD']) { // streaming with tbrcmd $cmd = $config['tamburineCMD'] . " getpls " . $streamData['pid'] . " 2>&1"; exec($cmd, $output, $retval); debug("cmd", $cmd); //debug("output", $output); //debug("retval", $retval); foreach ($output as $line) { if (preg_match('/\\-\\>(\\/\\S+)\\s*$/', $line, $mm)) { $filename = $mm[1]; break; } } } if ($filename) { $prg = sotf_Programme::getPrgFromFilename($filename); if (is_object($prg)) { return array('name' => $prg->get('title'), 'url' => $config['localPrefix'] . "/get.php/" . $prg->id); } else { return array('name' => $prg); } } else { debug("Could not get stream info"); // TODO: stop stream! } }