From 0debbfcc7c496a8ac9d4c6f1badf01db7afcbc96 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 15 Jan 2015 15:26:52 +0300 Subject: [PATCH] neutrino.cpp: force adding shutdown event after record stop, in case soft-standby by power key disabled but box mode switched to standby to finish record --- src/driver/rcinput.h | 2 +- src/neutrino.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index f8dc8e906..a6d43e9db 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -154,7 +154,6 @@ class CRCInput int fd_max; int clickfd; - bool firstKey; __u16 rc_last_key; void set_dsp(); @@ -284,6 +283,7 @@ class CRCInput uint64_t repeat_block; uint64_t repeat_block_generic; + bool firstKey; CRCInput(); //constructor - opens rc-device and starts needed threads ~CRCInput(); //destructor - closes rc-device diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 238969bf2..f5a3121af 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -117,6 +117,7 @@ #include #include +#include #include #include @@ -2746,8 +2747,14 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) /* shuts down the system even if !g_settings.shutdown_real_rcdelay (see below) */ gettimeofday(&standby_pressed_at, NULL); - if ((mode != mode_standby) && (g_settings.shutdown_real) && !recordingstatus) { - new_msg = NeutrinoMessages::SHUTDOWN; + if ((mode != mode_standby) && (g_settings.shutdown_real)) { + CRecordManager::getInstance()->StopAutoRecord(); + if(CRecordManager::getInstance()->RecordingStatus()) { + new_msg = NeutrinoMessages::STANDBY_ON; + CTimerManager::getInstance()->wakeup = true; + g_RCInput->firstKey = false; + } else + new_msg = NeutrinoMessages::SHUTDOWN; } else { new_msg = (mode == mode_standby) ? NeutrinoMessages::STANDBY_OFF : NeutrinoMessages::STANDBY_ON;