Edits to accomodate with abstracted semaphore class

This commit is contained in:
Erik Zandvliet 2014-04-23 13:07:01 +02:00 committed by Thulinma
parent ee93e80b8d
commit 10ce807f6f
5 changed files with 80 additions and 54 deletions

View file

@ -82,7 +82,7 @@ namespace Mist {
return;
}
isInitialized = true;
streamIndex.init(streamName,0);
streamIndex.init(streamName,8 * 1024 * 1024);
if (!streamIndex.mapped){
DEBUG_MSG(DLVL_FAIL, "Could not connect to server for %s\n", streamName.c_str());
onFail();
@ -239,7 +239,7 @@ namespace Mist {
if (!indexPages.count(trackId)){
char id[100];
sprintf(id, "%s%lu", streamName.c_str(), trackId);
indexPages[trackId].init(id, 8192);
indexPages[trackId].init(id, 8 * 1024);
}
while (pageNum == -1 || keyAmount == -1){
for (int i = 0; i < indexPages[trackId].len / 8; i++){
@ -285,7 +285,7 @@ namespace Mist {
}
char id[100];
sprintf(id, "%s%lu_%d", streamName.c_str(), trackId, pageNum);
curPages[trackId].init(std::string(id),0);
curPages[trackId].init(std::string(id),26 * 1024 * 1024);
if (!(curPages[trackId].mapped)){
DEBUG_MSG(DLVL_FAIL, "Initializing page %s failed", curPages[trackId].name.c_str());
return;

View file

@ -609,7 +609,7 @@ namespace Mist {
//open new page
char nextPage[100];
sprintf(nextPage, "%s%llu_%d", streamName.c_str(), tNum, bookKeeping[tNum].pageNum + bookKeeping[tNum].keyNum);
curPages[tNum].init(nextPage, 0, false);
curPages[tNum].init(nextPage, 26 * 1024 * 1024);
bookKeeping[tNum].pageNum += bookKeeping[tNum].keyNum;
bookKeeping[tNum].keyNum = 0;
bookKeeping[tNum].curOffset = 0;
@ -667,7 +667,7 @@ namespace Mist {
for (std::map<int, int>::iterator it = trackMap.begin(); it != trackMap.end(); it++){
char tmp[100];
sprintf( tmp, "liveStream_%s%d", streamName.c_str(), it->second);
metaPages[it->second].init(std::string(tmp), 0, false);
metaPages[it->second].init(std::string(tmp), 8 * 1024 * 1024);
DTSC::Meta tmpMeta = meta_out;
tmpMeta.tracks.clear();
tmpMeta.tracks[it->second] = meta_out.tracks[it->first];
@ -719,7 +719,7 @@ namespace Mist {
}else{
char firstPage[100];
sprintf(firstPage, "%s%lu_%d", streamName.c_str(), tNum, 0);
curPages[tNum].init(firstPage, 0, false);
curPages[tNum].init(firstPage, 8 * 1024 * 1024);
bookKeeping[tNum] = DTSCPageData();
DEBUG_MSG(DLVL_WARN, "Buffer accepted track %lu", tNum);
}