Added some helpful high-level debug messages to generic IO handlers, fixed missing track selection when streaming live input
This commit is contained in:
parent
4710fcade4
commit
18f9d2682f
3 changed files with 9 additions and 4 deletions
|
@ -400,6 +400,7 @@ namespace Mist {
|
|||
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){
|
||||
it->second.firstms = 0;
|
||||
it->second.lastms = 0;
|
||||
selectedTracks.insert(it->first);
|
||||
}
|
||||
|
||||
std::string reason = streamMainLoop();
|
||||
|
@ -650,6 +651,7 @@ namespace Mist {
|
|||
getNext();
|
||||
//in case earlier seeking was inprecise, seek to the exact point
|
||||
while (thisPacket && thisPacket.getTime() < (unsigned long long)myMeta.tracks[track].keys[keyNum - 1].getTime()){
|
||||
DONTEVEN_MSG("Skipping packet: %d@%llu, %llub", track, thisPacket.getTime(), thisPacket.getDataLen());
|
||||
getNext();
|
||||
}
|
||||
uint64_t lastBuffered = 0;
|
||||
|
@ -657,6 +659,7 @@ namespace Mist {
|
|||
uint64_t byteCounter = 0;
|
||||
while (thisPacket && thisPacket.getTime() < stopTime) {
|
||||
if (thisPacket.getTime() >= lastBuffered){
|
||||
DONTEVEN_MSG("Buffering packet: %d@%llu, %llub", track, thisPacket.getTime(), thisPacket.getDataLen());
|
||||
bufferNext(thisPacket);
|
||||
++packCounter;
|
||||
byteCounter += thisPacket.getDataLen();
|
||||
|
@ -666,7 +669,7 @@ namespace Mist {
|
|||
}
|
||||
bufferFinalize(track);
|
||||
bufferTimer = Util::bootMS() - bufferTimer;
|
||||
DEBUG_MSG(DLVL_DEVEL, "Done buffering page %d (%llu packets, %llu bytes, %llu-%llums) for track %d (%s) in %llums", keyNum, packCounter, byteCounter, myMeta.tracks[track].keys[keyNum - 1].getTime(), stopTime, track, myMeta.tracks[track].codec.c_str(), bufferTimer);
|
||||
DEBUG_MSG(DLVL_DEVEL, "Done buffering page %d (%llu packets, %llu bytes, %llu-%llums -> %llums) for track %d (%s) in %llums", keyNum, packCounter, byteCounter, myMeta.tracks[track].keys[keyNum - 1].getTime(), stopTime, lastBuffered, track, myMeta.tracks[track].codec.c_str(), bufferTimer);
|
||||
pageCounter[track][keyNum] = 15;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ namespace Mist {
|
|||
size_t curOffset = pageData.curOffset;
|
||||
//Do nothing when there is not enough free space on the page to add the packet.
|
||||
if (pageData.dataSize - curOffset < pack.getDataLen()) {
|
||||
FAIL_MSG("Trying to buffer a packet on page %lu for track %lu~>%lu, but we have a size mismatch. The packet is %d bytes long, so won't fit at offset %lu on a page of %llu bytes!", curPageNum[tid], tid, mapTid, pack.getDataLen(), curOffset, pageData.dataSize);
|
||||
FAIL_MSG("Trying to buffer a packet (%llums) on page %lu for track %lu~>%lu, but we have a size mismatch. The packet is %d bytes long, so won't fit at offset %lu on a page of %llu bytes!", pack.getTime(), curPageNum[tid], tid, mapTid, pack.getDataLen(), curOffset, pageData.dataSize);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -899,10 +899,12 @@ namespace Mist{
|
|||
loadPageForKey(nxt.tid, ++nxtKeyNum[nxt.tid]);
|
||||
nxt.offset = 0;
|
||||
if (nProxy.curPage.count(nxt.tid) && nProxy.curPage[nxt.tid].mapped){
|
||||
if (getDTSCTime(nProxy.curPage[nxt.tid].mapped, nxt.offset) < nxt.time){
|
||||
uint64_t newTime = getDTSCTime(nProxy.curPage[nxt.tid].mapped, nxt.offset);
|
||||
VERYHIGH_MSG("New page %llu for track %llu, first timestamp is %llu ms", nxtKeyNum[nxt.tid], nxt.tid, newTime);
|
||||
if (newTime < nxt.time){
|
||||
dropTrack(nxt.tid, "time going backwards");
|
||||
}else{
|
||||
nxt.time = getDTSCTime(nProxy.curPage[nxt.tid].mapped, nxt.offset);
|
||||
nxt.time = newTime;
|
||||
//swap out the next object in the buffer with a new one
|
||||
buffer.erase(buffer.begin());
|
||||
buffer.insert(nxt);
|
||||
|
|
Loading…
Add table
Reference in a new issue