Stability improvements for live buffers / fixed issues with file extensions in RTMP stream names.
This commit is contained in:
parent
9bdf5ee19b
commit
39a386ab18
3 changed files with 20 additions and 10 deletions
|
@ -197,17 +197,21 @@ namespace Mist {
|
|||
}
|
||||
int pageNum = bookKeeping[tNum].pageNum;
|
||||
std::string tmp = pack.toNetPacked();
|
||||
if (bookKeeping[tNum].curOffset > 8388608 && pack.isMember("keyframe") && pack["keyframe"]){
|
||||
Util::sleep(500);
|
||||
if (bookKeeping[tNum].curOffset > FLIP_DATA_PAGE_SIZE && pack.isMember("keyframe") && pack["keyframe"]){
|
||||
//open new page
|
||||
char nextPage[100];
|
||||
sprintf(nextPage, "%s%llu_%d", streamName.c_str(), tNum, bookKeeping[tNum].pageNum + bookKeeping[tNum].keyNum);
|
||||
INFO_MSG("Continuing track %llu on page %d", tNum, bookKeeping[tNum].pageNum + bookKeeping[tNum].keyNum);
|
||||
INFO_MSG("Continuing track %llu on page %d, from pos %llu", tNum, bookKeeping[tNum].pageNum + bookKeeping[tNum].keyNum, bookKeeping[tNum].curOffset);
|
||||
curPages[tNum].init(nextPage, DEFAULT_DATA_PAGE_SIZE);
|
||||
bookKeeping[tNum].pageNum += bookKeeping[tNum].keyNum;
|
||||
bookKeeping[tNum].keyNum = 0;
|
||||
bookKeeping[tNum].curOffset = 0;
|
||||
}
|
||||
if (!curPages[tNum].mapped){
|
||||
//prevent page init failures from crashing everything.
|
||||
myConn.close();//closes the connection to trigger a clean shutdown
|
||||
return;
|
||||
}
|
||||
if (bookKeeping[tNum].curOffset + tmp.size() < (unsigned long long)curPages[tNum].len){
|
||||
bookKeeping[tNum].keyNum += (pack.isMember("keyframe") && pack["keyframe"]);
|
||||
memcpy(curPages[tNum].mapped + bookKeeping[tNum].curOffset, tmp.data(), tmp.size());
|
||||
|
|
|
@ -518,10 +518,16 @@ namespace Mist {
|
|||
//handle variables
|
||||
if (streamName.find('?') != std::string::npos){
|
||||
std::string tmpVars = streamName.substr(streamName.find('?') + 1);
|
||||
streamName = streamName.substr(0, streamName.find('?'));
|
||||
parseVars(tmpVars);
|
||||
Util::sanitizeName(streamName);
|
||||
}
|
||||
|
||||
|
||||
size_t colonPos = streamName.find(':');
|
||||
if (colonPos != std::string::npos && colonPos < 6){
|
||||
std::string oldName = streamName;
|
||||
streamName = oldName.substr(colonPos + 1) + std::string(".") + oldName.substr(0, colonPos);
|
||||
}
|
||||
Util::sanitizeName(streamName);
|
||||
initialize();
|
||||
|
||||
//send a status reply
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue