Added various VERYHIGH level debug messages to buffering, fixed streams with no more than 1 keyframe in each track not working.
This commit is contained in:
parent
eaabf9e800
commit
9577f99ce0
2 changed files with 8 additions and 1 deletions
|
@ -320,8 +320,10 @@ namespace Mist {
|
||||||
|
|
||||||
|
|
||||||
bool Input::bufferFrame(unsigned int track, unsigned int keyNum){
|
bool Input::bufferFrame(unsigned int track, unsigned int keyNum){
|
||||||
if (keyNum >= myMeta.tracks[track].keys.size()){
|
VERYHIGH_MSG("bufferFrame for stream %s, track %u, key %u", streamName.c_str(), track, keyNum);
|
||||||
|
if (keyNum > myMeta.tracks[track].keys.size()){
|
||||||
//End of movie here, returning true to avoid various error messages
|
//End of movie here, returning true to avoid various error messages
|
||||||
|
VERYHIGH_MSG("Key number is higher than total key count. Cancelling bufferFrame");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (keyNum < 1){keyNum = 1;}
|
if (keyNum < 1){keyNum = 1;}
|
||||||
|
@ -336,15 +338,18 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pageCounter[track][pageNumber] = 15;
|
pageCounter[track][pageNumber] = 15;
|
||||||
|
VERYHIGH_MSG("Key %u is already buffered in page %n. Cancelling bufferFrame", keyNum, pageNumber);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!pagesByTrack.count(track)){
|
if (!pagesByTrack.count(track)){
|
||||||
|
WARN_MSG("No pages for track %u found! Cancelling bufferFrame", track);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Update keynum to point to the corresponding page
|
//Update keynum to point to the corresponding page
|
||||||
INFO_MSG("Updating keynum %u to %lu", keyNum, (--(pagesByTrack[track].upper_bound(keyNum)))->first);
|
INFO_MSG("Updating keynum %u to %lu", keyNum, (--(pagesByTrack[track].upper_bound(keyNum)))->first);
|
||||||
keyNum = (--(pagesByTrack[track].upper_bound(keyNum)))->first;
|
keyNum = (--(pagesByTrack[track].upper_bound(keyNum)))->first;
|
||||||
if (!bufferStart(track, keyNum)){
|
if (!bufferStart(track, keyNum)){
|
||||||
|
WARN_MSG("bufferStart failed! Cancelling bufferFrame", track);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ namespace Mist {
|
||||||
///
|
///
|
||||||
///Assumes myMeta contains the metadata to write.
|
///Assumes myMeta contains the metadata to write.
|
||||||
void InOutBase::initiateMeta() {
|
void InOutBase::initiateMeta() {
|
||||||
|
VERYHIGH_MSG("initiateMeta for stream %s", streamName.c_str());
|
||||||
//Open the page for the metadata
|
//Open the page for the metadata
|
||||||
char pageName[NAME_BUFFER_SIZE];
|
char pageName[NAME_BUFFER_SIZE];
|
||||||
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
|
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
|
||||||
|
@ -25,6 +26,7 @@ namespace Mist {
|
||||||
///\param tid The trackid of the page to start buffering
|
///\param tid The trackid of the page to start buffering
|
||||||
///\param pageNumber The number of the page to start buffering
|
///\param pageNumber The number of the page to start buffering
|
||||||
bool InOutBase::bufferStart(unsigned long tid, unsigned long pageNumber) {
|
bool InOutBase::bufferStart(unsigned long tid, unsigned long pageNumber) {
|
||||||
|
VERYHIGH_MSG("bufferStart for stream %s, track %lu, page %lu", streamName.c_str(), tid, pageNumber);
|
||||||
//Initialize the stream metadata if it does not yet exist
|
//Initialize the stream metadata if it does not yet exist
|
||||||
if (!metaPages.count(0)) {
|
if (!metaPages.count(0)) {
|
||||||
initiateMeta();
|
initiateMeta();
|
||||||
|
|
Loading…
Add table
Reference in a new issue