Merge branch 'development' into LTS_development
# Conflicts: # src/input/input_buffer.cpp
This commit is contained in:
commit
d522c1d90f
5 changed files with 48 additions and 27 deletions
|
@ -1319,7 +1319,7 @@ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
|
|||
if (streamIndex.mapped){
|
||||
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);
|
||||
IPC::semaphore metaLocker(liveSemName, O_CREAT | O_RDWR, (S_IRWXU|S_IRWXG|S_IRWXO), 8);
|
||||
metaLocker.wait();
|
||||
DTSC::Scan strm = DTSC::Packet(streamIndex.mapped, streamIndex.len, true).getScan();
|
||||
uint64_t lms = 0;
|
||||
|
|
|
@ -341,9 +341,16 @@ namespace Mist {
|
|||
if (!liveMeta){
|
||||
static char liveSemName[NAME_BUFFER_SIZE];
|
||||
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, streamName.c_str());
|
||||
liveMeta = new IPC::semaphore(liveSemName, O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
||||
liveMeta = new IPC::semaphore(liveSemName, O_CREAT | O_RDWR, ACCESSPERMS, 8);
|
||||
}
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
liveMeta->wait();
|
||||
|
||||
if (!nProxy.metaPages.count(0) || !nProxy.metaPages[0].mapped) {
|
||||
char pageName[NAME_BUFFER_SIZE];
|
||||
|
@ -354,6 +361,13 @@ namespace Mist {
|
|||
myMeta.writeTo(nProxy.metaPages[0].mapped);
|
||||
memset(nProxy.metaPages[0].mapped + myMeta.getSendLen(), 0, (nProxy.metaPages[0].len > myMeta.getSendLen() ? std::min((size_t)(nProxy.metaPages[0].len - myMeta.getSendLen()), (size_t)4) : 0));
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
liveMeta->post();
|
||||
}
|
||||
|
||||
///Checks if removing a key from this track is allowed/safe, and if so, removes it.
|
||||
|
@ -722,12 +736,12 @@ namespace Mist {
|
|||
updateTrackMeta(finalMap);
|
||||
hasPush = true;
|
||||
}
|
||||
//Update the metadata to reflect all changes
|
||||
updateMeta();
|
||||
//Write the final mapped track number and keyframe number to the user page element
|
||||
//This is used to resume pushing as well as pushing new tracks
|
||||
userConn.setTrackId(index, finalMap);
|
||||
userConn.setKeynum(index, myMeta.tracks[finalMap].keys.size());
|
||||
//Update the metadata to reflect all changes
|
||||
updateMeta();
|
||||
continue;
|
||||
}
|
||||
//Set the temporary track id for this item, and increase the temporary value for use with the next track
|
||||
|
@ -859,6 +873,8 @@ namespace Mist {
|
|||
myMeta.tracks[finalMap].lastms = 0;
|
||||
myMeta.tracks[finalMap].trackID = finalMap;
|
||||
}
|
||||
//Update the metadata to reflect all changes
|
||||
updateMeta();
|
||||
//Write the final mapped track number and keyframe number to the user page element
|
||||
//This is used to resume pushing as well as pushing new tracks
|
||||
userConn.setTrackId(index, finalMap);
|
||||
|
@ -867,8 +883,6 @@ namespace Mist {
|
|||
}else{
|
||||
userConn.setKeynum(index, 0);
|
||||
}
|
||||
//Update the metadata to reflect all changes
|
||||
updateMeta();
|
||||
}
|
||||
//If the track is active, and this is the element responsible for pushing it
|
||||
if (activeTracks.count(value) && pushLocation[value] == data) {
|
||||
|
@ -914,7 +928,6 @@ namespace Mist {
|
|||
for (std::map<unsigned long, DTSCPageData>::iterator pageIt = locations.begin(); pageIt != locations.end(); pageIt++) {
|
||||
updateMetaFromPage(tNum, pageIt->first);
|
||||
}
|
||||
updateMeta();
|
||||
}
|
||||
|
||||
void inputBuffer::updateMetaFromPage(unsigned long tNum, unsigned long pageNum) {
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace Mist{
|
|||
if (!myMeta.vod){
|
||||
static char liveSemName[NAME_BUFFER_SIZE];
|
||||
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, streamName.c_str());
|
||||
liveSem = new IPC::semaphore(liveSemName, O_RDWR, ACCESSPERMS, 1, !myMeta.live);
|
||||
liveSem = new IPC::semaphore(liveSemName, O_RDWR, ACCESSPERMS, 8, !myMeta.live);
|
||||
if (*liveSem){
|
||||
liveSem->wait();
|
||||
}else{
|
||||
|
@ -1828,7 +1828,7 @@ namespace Mist{
|
|||
IPC::semaphore * liveSem = 0;
|
||||
static char liveSemName[NAME_BUFFER_SIZE];
|
||||
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, streamName.c_str());
|
||||
liveSem = new IPC::semaphore(liveSemName, O_RDWR, ACCESSPERMS, 1, !myMeta.live);
|
||||
liveSem = new IPC::semaphore(liveSemName, O_RDWR, ACCESSPERMS, 8, !myMeta.live);
|
||||
if (*liveSem){
|
||||
liveSem->wait();
|
||||
}else{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue