diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp index 673bfc6c2..a9921dd93 100644 --- a/src/driver/scanepg.cpp +++ b/src/driver/scanepg.cpp @@ -334,7 +334,6 @@ void CEpgScan::EnterStandby() CZapit::getInstance()->SetCurrentChannelID(live_channel_id); CNeutrinoApp::getInstance()->standbyToStandby(); - //NI if (g_settings.epg_save && g_settings.epg_save_standby) CNeutrinoApp::getInstance()->saveEpg(NeutrinoModes::mode_standby); } diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index 738f2d01f..4283a6f14 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -55,6 +55,21 @@ CComponentsTimer::~CComponentsTimer() stopTimer(); } +int CComponentsTimer::getSleep(long miliseconds) +{ + struct timespec req, rem; + + if(miliseconds > 999){ + req.tv_sec = (time_t)(miliseconds / 1000); + req.tv_nsec = (miliseconds - ((long)req.tv_sec * 1000)) * 1000000; + }else{ + req.tv_sec = 0; + req.tv_nsec = miliseconds * 1000000; + } + + return nanosleep(&req , &rem); +} + void CComponentsTimer::runSharedTimerAction() { //start loop @@ -63,10 +78,18 @@ void CComponentsTimer::runSharedTimerAction() while(tm_enable && tm_interval > 0) { tm_mutex.lock(); OnTimer(); - if (!tm_enable_nano) + if (!tm_enable_nano){ sleep(tm_interval); - else - usleep((useconds_t)tm_interval); + }else{ + //behavior is different on cst hardware + long corr_factor = 1; +#if ! HAVE_COOL_HARDWARE + corr_factor = 10; +#endif + int res = getSleep(tm_interval * corr_factor); + if (res != 0) + dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR: returns [%d] \033[0m\n", __func__, __LINE__, res); + } tm_mutex.unlock(); } diff --git a/src/gui/components/cc_timer.h b/src/gui/components/cc_timer.h index dc6d090c7..61623d474 100644 --- a/src/gui/components/cc_timer.h +++ b/src/gui/components/cc_timer.h @@ -70,6 +70,9 @@ class CComponentsTimer : public sigc::trackable OpenThreads::Mutex tm_mutex; ///slot for restart signals sigc::slot0 sl_stop_timer; + + ///sleep generated with nanosleep + int getSleep(long miliseconds); public: /**Constructor for timer class * diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0724876e0..84a625111 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4065,7 +4065,7 @@ void CNeutrinoApp::ExitRun(int exit_code) if(g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_POPUP) InfoIcons->saveIconstate(); - if(SDTreloadChannels) + if (SDTreloadChannels) SDT_ReloadChannels(); dprintf(DEBUG_INFO, "exit\n"); diff --git a/src/shutdown_helper.c b/src/shutdown_helper.c index 55fb76739..52acdfb93 100644 --- a/src/shutdown_helper.c +++ b/src/shutdown_helper.c @@ -55,6 +55,8 @@ int main(int argc, char **argv) fp.timer_minutes_hi = fp_timer >> 8;; fp.timer_minutes_lo = fp_timer & 0xFF; + system("/etc/init.d/rcK"); + fd = open("/dev/display", O_RDONLY); if (fd < 0) perror("/dev/display");