From 0bda57fa0cd8e5d4332f9c8e29d7889a4e652b9a Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 22 Jul 2015 09:53:04 +0200 Subject: [PATCH 1/2] When reconnecting, close old connections to userClient/statsPage first to prevent accidental killing of outputs. --- src/output/output.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/output/output.cpp b/src/output/output.cpp index effe8489..731fd92e 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -122,7 +122,13 @@ namespace Mist { onFail(); return; } + if (statsPage.getData()){ + statsPage.finish(); + } statsPage = IPC::sharedClient(SHM_STATISTICS, STAT_EX_SIZE, true); + if (userClient.getData()){ + userClient.finish(); + } char userPageName[NAME_BUFFER_SIZE]; snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str()); userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true); From 27240abd0635f34eb2f683653df50e2dca73393c Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 22 Jul 2015 09:53:36 +0200 Subject: [PATCH 2/2] Clarified debug messages, tweaked verbosity levels. --- src/input/input.cpp | 2 +- src/io.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/input/input.cpp b/src/input/input.cpp index 8a0e1550..77e6d78e 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -346,7 +346,7 @@ namespace Mist { return false; } //Update keynum to point to the corresponding page - INFO_MSG("Updating keynum %u to %lu", keyNum, (--(pagesByTrack[track].upper_bound(keyNum)))->first); + INFO_MSG("Loading key %u from page %lu", keyNum, (--(pagesByTrack[track].upper_bound(keyNum)))->first); keyNum = (--(pagesByTrack[track].upper_bound(keyNum)))->first; if (!bufferStart(track, keyNum)){ WARN_MSG("bufferStart failed! Cancelling bufferFrame", track); diff --git a/src/io.cpp b/src/io.cpp index 5362fc22..1a250278 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -112,7 +112,7 @@ namespace Mist { } } - INFO_MSG("Start buffering page %lu on track %lu~>%lu successful", pageNumber, tid, mapTid); + HIGH_MSG("Start buffering page %lu on track %lu~>%lu successful", pageNumber, tid, mapTid); ///\return true if everything was successful return true; } @@ -304,9 +304,9 @@ namespace Mist { //Print a message about registering the page or not. if (!inserted) { - INFO_MSG("Can't register page %lu on the metaPage of track %lu~>%lu, No empty spots left within 'should be' amount of slots", curPageNum[tid], tid, mapTid); + FAIL_MSG("Can't register page %lu on the metaPage of track %lu~>%lu, No empty spots left within 'should be' amount of slots", curPageNum[tid], tid, mapTid); } else { - INFO_MSG("Succesfully registered page %lu on the metaPage of track %lu~>%lu.", curPageNum[tid], tid, mapTid); + HIGH_MSG("Succesfully registered page %lu on the metaPage of track %lu~>%lu.", curPageNum[tid], tid, mapTid); } //Close our link to the page. This will NOT destroy the shared page, as we've set master to false upon construction #if defined(__CYGWIN__) || defined(_WIN32) @@ -430,7 +430,7 @@ namespace Mist { userClient.keepAlive(); if (trackMap.count(tid) && !trackState.count(tid)) { //If the trackmap has been set manually, don't negotiate - INFO_MSG("Manually Set TrackMap"); + HIGH_MSG("TrackMap manual, not negotiating track IDs"); trackState[tid] = FILL_ACC; char pageName[NAME_BUFFER_SIZE]; snprintf(pageName, NAME_BUFFER_SIZE, SHM_TRACK_INDEX, streamName.c_str(), tid);