Removed 5s timeout from streamAlive call.
This commit is contained in:
parent
6386060c10
commit
fa41e02047
8 changed files with 36 additions and 27 deletions
|
@ -783,7 +783,9 @@ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
|
|||
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, it->c_str());
|
||||
streamIndex.init(pageId, DEFAULT_META_PAGE_SIZE, false, false);
|
||||
if (streamIndex.mapped){
|
||||
IPC::semaphore metaLocker(std::string("liveMeta@" + (*it)).c_str(), O_CREAT | O_RDWR, (S_IRWXU|S_IRWXG|S_IRWXO), 1);
|
||||
static char liveSemName[NAME_BUFFER_SIZE];
|
||||
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, it->c_str());
|
||||
IPC::semaphore metaLocker(liveSemName, O_CREAT | O_RDWR, (S_IRWXU|S_IRWXG|S_IRWXO), 1);
|
||||
metaLocker.wait();
|
||||
DTSC::Scan strm = DTSC::Packet(streamIndex.mapped, streamIndex.len, true).getScan();
|
||||
long long lms = 0;
|
||||
|
|
|
@ -195,8 +195,14 @@ namespace Mist {
|
|||
/// ~~~~~~~~~~~~~~~
|
||||
//
|
||||
void Input::serve(){
|
||||
if (!isBuffer) {
|
||||
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) {
|
||||
bufferFrame(it->first, 1);
|
||||
}
|
||||
}
|
||||
char userPageName[NAME_BUFFER_SIZE];
|
||||
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
|
||||
userPage.init(userPageName, PLAY_EX_SIZE, true);
|
||||
/*LTS-START*/
|
||||
if(Triggers::shouldTrigger("STREAM_READY", config->getString("streamname"))){
|
||||
std::string payload = config->getString("streamname")+"\n" +capa["name"].asStringRef()+"\n";
|
||||
|
@ -205,12 +211,6 @@ namespace Mist {
|
|||
}
|
||||
}
|
||||
/*LTS-END*/
|
||||
userPage.init(userPageName, PLAY_EX_SIZE, true);
|
||||
if (!isBuffer) {
|
||||
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) {
|
||||
bufferFrame(it->first, 1);
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_MSG(DLVL_DEVEL, "Input for stream %s started", streamName.c_str());
|
||||
|
||||
|
|
|
@ -278,15 +278,6 @@ namespace Mist {
|
|||
onFail();
|
||||
return;
|
||||
}
|
||||
char pageId[NAME_BUFFER_SIZE];
|
||||
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
|
||||
nProxy.metaPages.clear();
|
||||
nProxy.metaPages[0].init(pageId, DEFAULT_META_PAGE_SIZE);
|
||||
if (!nProxy.metaPages[0].mapped){
|
||||
FAIL_MSG("Could not connect to server for %s", streamName.c_str());
|
||||
onFail();
|
||||
return;
|
||||
}
|
||||
if (statsPage.getData()){
|
||||
statsPage.finish();
|
||||
}
|
||||
|
@ -297,6 +288,15 @@ namespace Mist {
|
|||
char userPageName[NAME_BUFFER_SIZE];
|
||||
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
|
||||
nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);
|
||||
char pageId[NAME_BUFFER_SIZE];
|
||||
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
|
||||
nProxy.metaPages.clear();
|
||||
nProxy.metaPages[0].init(pageId, DEFAULT_META_PAGE_SIZE);
|
||||
if (!nProxy.metaPages[0].mapped){
|
||||
FAIL_MSG("Could not connect to server for %s", streamName.c_str());
|
||||
onFail();
|
||||
return;
|
||||
}
|
||||
updateMeta();
|
||||
}
|
||||
|
||||
|
|
|
@ -88,8 +88,7 @@ namespace Mist {
|
|||
}
|
||||
}
|
||||
}else{
|
||||
fastAsPossibleTime = 50000;//50 seconds
|
||||
realTime = 0;
|
||||
realTime = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -348,7 +348,9 @@ namespace Mist {
|
|||
json_resp["on_error"] = config->getString("nostreamtext");
|
||||
}
|
||||
IPC::semaphore configLock(SEM_CONF, O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
||||
IPC::semaphore metaLocker(std::string("liveMeta@" + streamName).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
||||
static char liveSemName[NAME_BUFFER_SIZE];
|
||||
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, streamName.c_str());
|
||||
IPC::semaphore metaLocker(liveSemName, O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
||||
bool metaLock = false;
|
||||
configLock.wait();
|
||||
IPC::sharedPage serverCfg(SHM_CONF, DEFAULT_CONF_PAGE_SIZE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue