From 82a2fb336708392816cac25ba5434d1e5c9f7f31 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 11 Oct 2016 15:12:12 +0200 Subject: [PATCH] Fixed eternal sleeping bug in outputs, fixed some missed thisPacket invalid pointer issues. --- src/output/output.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/output/output.cpp b/src/output/output.cpp index b103cf65..eaa68dab 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -673,7 +673,8 @@ namespace Mist { //slow down processing, if real time speed is wanted if (realTime){ - while (thisPacket.getTime() > (((Util::getMS() - firstTime)*1000)+maxSkipAhead)/realTime && config->is_active && myConn) { + uint8_t i = 6; + while (--i && thisPacket.getTime() > (((Util::getMS() - firstTime)*1000)+maxSkipAhead)/realTime && config->is_active && myConn) { Util::sleep(std::min(thisPacket.getTime() - (((Util::getMS() - firstTime)*1000)+minSkipAhead)/realTime, 1000llu)); stats(); } @@ -881,6 +882,7 @@ namespace Mist { //The next key showed up on another page! //We've simply reached the end of the page. Load the next key = next page. loadPageForKey(nxt.tid, ++nxtKeyNum[nxt.tid]); + thisPacket.null(); nxt.offset = 0; if (nProxy.curPage.count(nxt.tid) && nProxy.curPage[nxt.tid].mapped){ unsigned long long nextTime = getDTSCTime(nProxy.curPage[nxt.tid].mapped, nxt.offset); @@ -896,7 +898,6 @@ namespace Mist { MEDIUM_MSG("Next page for track %u starts at %llu.", nxt.tid, nxt.time); } }else{ - thisPacket.null(); dropTrack(nxt.tid, "page load failure"); } return false;