Fixed outputs not reporting their current position accurately, improved buffering behaviour for VoD inputs.
This commit is contained in:
parent
425e98c6fd
commit
b12c0254e1
2 changed files with 10 additions and 3 deletions
|
@ -631,15 +631,22 @@ namespace Mist {
|
|||
if (nProxy.isBuffered(track, keyNum)) {
|
||||
//get corresponding page number
|
||||
int pageNumber = 0;
|
||||
int pageSize = 0;
|
||||
for (std::map<unsigned long, DTSCPageData>::iterator it = nProxy.pagesByTrack[track].begin(); it != nProxy.pagesByTrack[track].end(); it++) {
|
||||
if (it->first <= keyNum) {
|
||||
pageNumber = it->first;
|
||||
pageSize = it->second.keyNum;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
pageCounter[track][pageNumber] = 15;
|
||||
VERYHIGH_MSG("Track %u, key %u is already buffered in page %d. Cancelling bufferFrame", track, keyNum, pageNumber);
|
||||
//If we're less than 10% off from the next page, make sure the next is also buffered.
|
||||
if (keyNum+pageSize/10 > pageNumber+pageSize){
|
||||
MEDIUM_MSG("Pre-buffering next page! (%u+%u/10 > %u+%u)", keyNum, pageSize, pageNumber, pageSize);
|
||||
return bufferFrame(track, pageNumber+pageSize+1);
|
||||
}
|
||||
VERYHIGH_MSG("Track %u, key %u is already buffered in page %d. Cancelling bufferFrame", track, keyNum, pageNumber);
|
||||
return true;
|
||||
}
|
||||
if (!nProxy.pagesByTrack.count(track)) {
|
||||
|
|
|
@ -1061,7 +1061,7 @@ namespace Mist{
|
|||
}
|
||||
|
||||
//when live, every keyframe, check correctness of the keyframe number
|
||||
if (myMeta.live && thisPacket.getFlag("keyframe")){
|
||||
if (thisPacket.getFlag("keyframe")){
|
||||
//cancel if not alive
|
||||
if (!nProxy.userClient.isAlive()){
|
||||
return false;
|
||||
|
@ -1070,7 +1070,7 @@ namespace Mist{
|
|||
//Failure here will cause tracks to drop due to inconsistent internal state.
|
||||
nxtKeyNum[nxt.tid] = getKeyForTime(nxt.tid, thisPacket.getTime());
|
||||
int counter = 0;
|
||||
while(counter < 40 && myMeta.tracks[nxt.tid].getKey(nxtKeyNum[nxt.tid]).getTime() != thisPacket.getTime()){
|
||||
while(myMeta.live && counter < 40 && myMeta.tracks[nxt.tid].getKey(nxtKeyNum[nxt.tid]).getTime() != thisPacket.getTime()){
|
||||
if (counter++){
|
||||
//Only sleep 250ms if this is not the first updatemeta try
|
||||
Util::wait(250);
|
||||
|
|
Loading…
Add table
Reference in a new issue