diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 7b3665e76..fdd166556 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -259,8 +259,8 @@ void CMoviePlayerGui::Init(void) isLuaPlay = false; haveLuaInfoFunc = false; blockedFromPlugin = false; - m_screensaver = false; - m_idletime = time(NULL); + + CScreenSaver::getInstance()->resetIdleTime(); } void CMoviePlayerGui::cutNeutrino() @@ -1666,26 +1666,27 @@ void CMoviePlayerGui::PlayFileLoop(void) showSubtitle(0); #endif + if (msg <= CRCInput::RC_MaxRC) + CScreenSaver::getInstance()->resetIdleTime(); + if (playstate == CMoviePlayerGui::PAUSE && (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER)) { - int delay = time(NULL) - m_idletime; - int screensaver_delay = g_settings.screensaver_delay; - if (screensaver_delay != 0 && delay > screensaver_delay*60 && !m_screensaver) { + time_t delay = time(NULL) - CScreenSaver::getInstance()->getIdleTime(); + if (g_settings.screensaver_delay && delay > g_settings.screensaver_delay*60 && !CScreenSaver::getInstance()->isActive()) + { videoDecoder->setBlank(true); - screensaver(true); + CScreenSaver::getInstance()->Start(); } } else { - m_idletime = time(NULL); - if (m_screensaver) + if (CScreenSaver::getInstance()->isActive()) { videoDecoder->setBlank(false); - screensaver(false); -#if 0 //ignore first keypress stop - just quit the screensaver and call infoviewer - if (msg <= CRCInput::RC_MaxRC) { -#endif - if (msg <= CRCInput::RC_stop) { + CScreenSaver::getInstance()->Stop(); + if (msg <= CRCInput::RC_MaxRC) + { + //ignore first keypress - just quit the screensaver and call infoviewer g_RCInput->clearRCMsg(); callInfoViewer(); continue; @@ -3508,18 +3509,3 @@ size_t CMoviePlayerGui::GetReadCount() last_read = this_read; return (size_t) res; } - -void CMoviePlayerGui::screensaver(bool on) -{ - if (on) - { - m_screensaver = true; - CScreenSaver::getInstance()->Start(); - } - else - { - CScreenSaver::getInstance()->Stop(); - m_screensaver = false; - m_idletime = time(NULL); - } -} diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index ee9dad0a0..d9c4e3b83 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -136,11 +136,6 @@ class CMoviePlayerGui : public CMenuTarget int currentapid, currentac3; repeat_mode_enum repeat_mode; - /* screensaver */ - int m_idletime; - bool m_screensaver; - void screensaver(bool on); - // subtitle data unsigned int numpids; #ifndef REC_MAX_SPIDS