Merge branch 'development' into LTS_development
# Conflicts: # src/input/input_buffer.cpp
This commit is contained in:
		
						commit
						9e10cc621c
					
				
					 2 changed files with 21 additions and 9 deletions
				
			
		| 
						 | 
					@ -274,8 +274,14 @@ namespace Mist {
 | 
				
			||||||
  void inputBuffer::finish() {
 | 
					  void inputBuffer::finish() {
 | 
				
			||||||
    Input::finish();
 | 
					    Input::finish();
 | 
				
			||||||
    updateMeta();
 | 
					    updateMeta();
 | 
				
			||||||
 | 
					    if (bufferLocations.size()){
 | 
				
			||||||
 | 
					      std::set<unsigned long> toErase;
 | 
				
			||||||
      for (std::map<unsigned long, std::map<unsigned long, DTSCPageData> >::iterator it = bufferLocations.begin(); it != bufferLocations.end(); it++){
 | 
					      for (std::map<unsigned long, std::map<unsigned long, DTSCPageData> >::iterator it = bufferLocations.begin(); it != bufferLocations.end(); it++){
 | 
				
			||||||
      eraseTrackDataPages(it->first);
 | 
					        toErase.insert(it->first);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      for (std::set<unsigned long>::iterator it = toErase.begin(); it != toErase.end(); ++it){
 | 
				
			||||||
 | 
					        eraseTrackDataPages(*it);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -602,7 +608,7 @@ namespace Mist {
 | 
				
			||||||
    //Otherwise open and parse the page
 | 
					    //Otherwise open and parse the page
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //Open the page if it is not yet open
 | 
					    //Open the page if it is not yet open
 | 
				
			||||||
    if (!curPageNum.count(tNum) || curPageNum[tNum] != pageNum){
 | 
					    if (!curPageNum.count(tNum) || curPageNum[tNum] != pageNum || !curPage[tNum].mapped){
 | 
				
			||||||
      //DO NOT ERASE THE PAGE HERE, master is not set to true
 | 
					      //DO NOT ERASE THE PAGE HERE, master is not set to true
 | 
				
			||||||
      curPageNum.erase(tNum);
 | 
					      curPageNum.erase(tNum);
 | 
				
			||||||
      char nextPageName[NAME_BUFFER_SIZE];
 | 
					      char nextPageName[NAME_BUFFER_SIZE];
 | 
				
			||||||
| 
						 | 
					@ -618,6 +624,10 @@ namespace Mist {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DTSC::Packet tmpPack;
 | 
					    DTSC::Packet tmpPack;
 | 
				
			||||||
 | 
					    if (!curPage[tNum].mapped[pageData.curOffset]){
 | 
				
			||||||
 | 
					      VERYHIGH_MSG("No packet on page %lu for track %lu, waiting...", pageNum, tNum);
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    tmpPack.reInit(curPage[tNum].mapped + pageData.curOffset, 0);
 | 
					    tmpPack.reInit(curPage[tNum].mapped + pageData.curOffset, 0);
 | 
				
			||||||
    //No new data has been written on the page since last update
 | 
					    //No new data has been written on the page since last update
 | 
				
			||||||
    if (!tmpPack){
 | 
					    if (!tmpPack){
 | 
				
			||||||
| 
						 | 
					@ -626,7 +636,6 @@ namespace Mist {
 | 
				
			||||||
    lastUpdated[tNum] = Util::bootSecs();
 | 
					    lastUpdated[tNum] = Util::bootSecs();
 | 
				
			||||||
    while (tmpPack){
 | 
					    while (tmpPack){
 | 
				
			||||||
      //Update the metadata with this packet
 | 
					      //Update the metadata with this packet
 | 
				
			||||||
      ///\todo Why is there an LTS tag here?
 | 
					 | 
				
			||||||
      myMeta.update(tmpPack, segmentSize);/*LTS*/
 | 
					      myMeta.update(tmpPack, segmentSize);/*LTS*/
 | 
				
			||||||
      //Set the first time when appropriate
 | 
					      //Set the first time when appropriate
 | 
				
			||||||
      if (pageData.firstTime == 0){
 | 
					      if (pageData.firstTime == 0){
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -531,6 +531,9 @@ namespace Mist {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          INFO_MSG("Buffer has indicated that incoming track %lu should start writing on track %lu, page %lu", tid, finalTid, firstPage);
 | 
					          INFO_MSG("Buffer has indicated that incoming track %lu should start writing on track %lu, page %lu", tid, finalTid, firstPage);
 | 
				
			||||||
          trackMap[tid] = finalTid;
 | 
					          trackMap[tid] = finalTid;
 | 
				
			||||||
 | 
					          if (myMeta.tracks.count(finalTid) && myMeta.tracks[finalTid].lastms){
 | 
				
			||||||
 | 
					            myMeta.tracks[finalTid].lastms = 0;
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
          trackState[tid] = FILL_ACC;
 | 
					          trackState[tid] = FILL_ACC;
 | 
				
			||||||
          char pageName[NAME_BUFFER_SIZE];
 | 
					          char pageName[NAME_BUFFER_SIZE];
 | 
				
			||||||
          snprintf(pageName, NAME_BUFFER_SIZE, SHM_TRACK_INDEX, streamName.c_str(), finalTid);
 | 
					          snprintf(pageName, NAME_BUFFER_SIZE, SHM_TRACK_INDEX, streamName.c_str(), finalTid);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue