From 3019b1abdc78b969cfcc59c2aac3b775d0ca8298 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 24 Nov 2016 19:21:14 +0100 Subject: [PATCH 1/2] src/gui/widget/menue.cpp try to fix widget segfault menu with keyboard and background restore Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a8ea7c60d50d39087866df61df56881d44ebdb7e Author: Jacek Jendrzej Date: 2016-11-24 (Thu, 24 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 13 +++++++++---- src/gui/widget/menue.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3711cb1bd..8a2550ceb 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -622,6 +622,8 @@ void CMenuWidget::Init(const std::string &Icon, const int mwidth, const mn_widge fbutton_width = 0; fbutton_height = 0; nextShortcut = 1; + saveScreen_width = 0; + saveScreen_height = 0; } void CMenuWidget::move(int xoff, int yoff) @@ -1391,17 +1393,18 @@ void CMenuWidget::saveScreen() return; delete[] background; - - background = new fb_pixel_t [full_width * (full_height+fbutton_height)]; + saveScreen_height = full_height+fbutton_height; + saveScreen_width = full_width; + background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); + frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); + frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, saveScreen_width, saveScreen_height, background); } } @@ -1411,6 +1414,8 @@ void CMenuWidget::enableSaveScreen(bool enable) if (!enable && background) { delete[] background; background = NULL; + saveScreen_width = 0; + saveScreen_height = 0; } } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index bc527ed68..61d6691b4 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -494,6 +494,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals CComponentsInfoBox *info_box; int hint_height; CComponentsHeader *header; + unsigned int saveScreen_width ; + unsigned int saveScreen_height; protected: std::string nameString; neutrino_locale_t name; From a85e6a2971500b40395ae9770bba66fb175053ea Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 24 Nov 2016 21:41:23 +0100 Subject: [PATCH 2/2] enable epg-scan while audioplayer, movieplayer, pictureviewer and upnp-browser runs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5bc693282bf38aa8848c5bd871bc8c80b2d71a1 Author: vanhofen Date: 2016-11-24 (Thu, 24 Nov 2016) Origin message was: ------------------ - enable epg-scan while audioplayer, movieplayer, pictureviewer and upnp-browser runs ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 6 +----- src/gui/movieplayer.cpp | 3 --- src/gui/pictureviewer.cpp | 6 ------ src/gui/upnpbrowser.cpp | 5 ----- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c96652ac9..151165907 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -293,9 +293,6 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_LastMode = CNeutrinoApp::getInstance()->getMode(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio ); - // Stop sectionsd - g_Sectionsd->setPauseScanning(true); - puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) perror(AUDIOPLAYER_START_SCRIPT " failed"); @@ -314,8 +311,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); + m_frameBuffer->stopFrame(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 960022af5..c16c21031 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -221,8 +221,6 @@ void CMoviePlayerGui::cutNeutrino() return; g_Zapit->lockPlayBack(); - if (!isWebTV) - g_Sectionsd->setPauseScanning(true); m_LastMode = (CNeutrinoApp::getInstance()->getMode() /*| NeutrinoMessages::norezap*/); if (isWebTV) @@ -245,7 +243,6 @@ void CMoviePlayerGui::restoreNeutrino() //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - g_Sectionsd->setPauseScanning(false); printf("%s: restore mode %x\n", __func__, m_LastMode);fflush(stdout); #if 0 diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 7d09f898f..97e335fa1 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -197,9 +197,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) // blank background screen videoDecoder->setBlank(true); - - // Stop Sectionsd - g_Sectionsd->setPauseScanning(true); } // Save and Clear background @@ -217,9 +214,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) if (!audioplayer) { // !!! why? !!! //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); } // Restore previous background diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 59221c059..92b90d749 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -183,9 +183,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - // Stop sectionsd - g_Sectionsd->setPauseScanning(true); - m_deviceliststart=0; m_selecteddevice=0; timeout = 0; @@ -194,8 +191,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ stopAudio(); - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); m_frameBuffer->stopFrame(); m_frameBuffer->Clear();