From ce660cf5483ca0d7ca490faae01b0a713ffc01a1 Mon Sep 17 00:00:00 2001 From: GetAway Date: Mon, 24 Sep 2018 15:00:14 +0200 Subject: [PATCH] infoviewer.cpp: prevent segfault if framebuffer is already deactivated in standby mode. (race condition) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f883d5c82a8f523f362740b8b32048c21e8d0bd0 Author: GetAway Date: 2018-09-24 (Mon, 24 Sep 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 54 +++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 3c4ed0104..18bfe314d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1172,34 +1172,38 @@ void CInfoViewer::loop(bool show_dot) res = messages_return::cancel_all; hideIt = true; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == sec_timer_id)) { - showSNR (); - //NI - if (timeset) + if (frameBuffer->getActive()) { - if (g_settings.infobar_analogclock) - showAnalogClock(BoxEndX - analogclock_offset - analogclock_size/2, BoxEndY - analogclock_offset - analogclock_size/2, analogclock_size/2); - else - clock->paint(CC_SAVE_SCREEN_NO); - } - showRecordIcon (show_dot); - show_dot = !show_dot; - showInfoFile(); - if ((g_settings.radiotext_enable) && (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_radio)) - showRadiotext(); - - infoViewerBB->showIcon_16_9(); - //infoViewerBB->paint_ca_icons(0); - //NI - if(file_exists("/tmp/ecm.info")) - { - std::string md5_tmp = filehash((char *)"/tmp/ecm.info"); - //printf("CInfoViewer::loop() ecm.info.tmp = %s\nCInfoViewer::loop() ecm.info = %s\n",md5_ecmInfo.c_str(),md5_tmp.c_str()); - if(md5_ecmInfo != md5_tmp) { - puts("CInfoViewer::loop() CA reload"); - infoViewerBB->paint_ca_icons(0); + showSNR (); + //NI + if (timeset) + { + if (g_settings.infobar_analogclock) + showAnalogClock(BoxEndX - analogclock_offset - analogclock_size/2, BoxEndY - analogclock_offset - analogclock_size/2, analogclock_size/2); + else + clock->paint(CC_SAVE_SCREEN_NO); } + showRecordIcon (show_dot); + show_dot = !show_dot; + showInfoFile(); + if ((g_settings.radiotext_enable) && (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_radio)) + showRadiotext(); + + infoViewerBB->showIcon_16_9(); + //infoViewerBB->paint_ca_icons(0); + //NI + if(file_exists("/tmp/ecm.info")) + { + std::string md5_tmp = filehash((char *)"/tmp/ecm.info"); + //printf("CInfoViewer::loop() ecm.info.tmp = %s\nCInfoViewer::loop() ecm.info = %s\n",md5_ecmInfo.c_str(),md5_tmp.c_str()); + if (md5_ecmInfo != md5_tmp) + { + puts("CInfoViewer::loop() CA reload"); + infoViewerBB->paint_ca_icons(0); + } + } + infoViewerBB->showIcon_Resolution(); } - infoViewerBB->showIcon_Resolution(); } else if ((msg == NeutrinoMessages::EVT_RECORDMODE) && (CMoviePlayerGui::getInstance().timeshift) && (CRecordManager::getInstance()->GetRecordCount() == 1)) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data);