From 7474d9f056bc87cfab2eadf8cb19ec1d9509f9be Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 25 Feb 2017 15:58:07 +0100 Subject: [PATCH 1/2] rcinput: apply ev.time adjustment to all events This fixes detection of keys that are allowed to be long-pressed if "long keypress" feature is enabled. No idea why this was applied only to key press events before :-) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3e5d77bfe1d1f85c47ca5ddfd4f9121253da316 Author: Stefan Seyfried Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 35c0a5542..657a2a244 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1320,21 +1320,19 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } if (ev.type == EV_SYN) continue; /* ignore... */ - if (ev.value) { - /* try to compensate for possible changes in wall clock - * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). - * so subtract gettimeofday() from ev.time and then add - * CLOCK_MONOTONIC, which is supposed to not change with settimeofday. - * Everything would be much easier if we could use the post-kernel 3.4 - * EVIOCSCLOCKID ioctl :-) */ - struct timespec t1; - now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; - if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { - struct timeval t2; - gettimeofday(&t2, NULL); - now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; - now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); - } + /* try to compensate for possible changes in wall clock + * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). + * so subtract gettimeofday() from ev.time and then add + * CLOCK_MONOTONIC, which is supposed to not change with settimeofday. + * Everything would be much easier if we could use the post-kernel 3.4 + * EVIOCSCLOCKID ioctl :-) */ + struct timespec t1; + now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; + if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { + struct timeval t2; + gettimeofday(&t2, NULL); + now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; + now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); } SHTDCNT::getInstance()->resetSleepTimer(); if (ev.value && firstKey) { From 94a27060331540a0f3ad356adc8a54e1516fe596 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 26 Feb 2017 00:06:32 +0100 Subject: [PATCH 2/2] timerlist: fix timer comparison in modifyTimer() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf9a1a705cf819e1112c20c20d09e823c4bb675f Author: vanhofen Date: 2017-02-26 (Sun, 26 Feb 2017) Origin message was: ------------------ - timerlist: fix timer comparison in modifyTimer() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f54d04c30..145360ee8 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1616,6 +1616,7 @@ int CTimerList::modifyTimer() if (!strlen(timer->recordingDir)) strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir.c_str(),sizeof(timer->recordingDir)-1); timer_recordingDir = timer->recordingDir; + strncpy(t_old.recordingDir, timer->recordingDir, sizeof(t_old.recordingDir)-1); bool recDirEnabled = (g_settings.recording_type == RECORDING_FILE); // obsolete? CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green);