1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a high CPU load during replay with active progress display

This commit is contained in:
Klaus Schmidinger 2018-04-14 10:24:41 +02:00
parent fb03134411
commit c057e057f9
4 changed files with 10 additions and 2 deletions

View File

@ -3314,6 +3314,7 @@ Matthias Senzel <matthias.senzel@t-online.de>
for reporting that the info of a newly edited recording was not available immediately for reporting that the info of a newly edited recording was not available immediately
after starting the editing process after starting the editing process
for reporting a problem with setting the initial offset of the cursor in a list menu for reporting a problem with setting the initial offset of the cursor in a list menu
for reporting a high CPU load during replay with active progress display
Marek Nazarko <mnazarko@gmail.com> Marek Nazarko <mnazarko@gmail.com>
for translating OSD texts to the Polish language for translating OSD texts to the Polish language

View File

@ -9344,3 +9344,5 @@ Video Disk Recorder Revision History
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Updated the Hungarian OSD texts (thanks to István Füley). - Updated the Hungarian OSD texts (thanks to István Füley).
- Updated the French OSD texts (thanks to Bernard Jaulin). - Updated the French OSD texts (thanks to Bernard Jaulin).
- Fixed a high CPU load during replay with active progress display (reported by Matthias
Senzel).

6
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 4.73 2018/04/09 09:20:03 kls Exp $ * $Id: menu.c 4.74 2018/04/14 10:24:41 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -45,6 +45,7 @@
#define MAXWAITFORCAMMENU 10 // seconds to wait for the CAM menu to open #define MAXWAITFORCAMMENU 10 // seconds to wait for the CAM menu to open
#define CAMMENURETRYTIMEOUT 3 // seconds after which opening the CAM menu is retried #define CAMMENURETRYTIMEOUT 3 // seconds after which opening the CAM menu is retried
#define CAMRESPONSETIMEOUT 5 // seconds to wait for a response from a CAM #define CAMRESPONSETIMEOUT 5 // seconds to wait for a response from a CAM
#define PROGRESSTIMEOUT 100 // milliseconds to wait before updating the replay progress display
#define MINFREEDISK 300 // minimum free disk space (in MB) required to start recording #define MINFREEDISK 300 // minimum free disk space (in MB) required to start recording
#define NODISKSPACEDELTA 300 // seconds between "Not enough disk space to start recording!" messages #define NODISKSPACEDELTA 300 // seconds between "Not enough disk space to start recording!" messages
#define MAXCHNAMWIDTH 16 // maximum number of characters of channels' short names shown in schedules menus #define MAXCHNAMWIDTH 16 // maximum number of characters of channels' short names shown in schedules menus
@ -5733,6 +5734,8 @@ void cReplayControl::ShowMode(void)
bool cReplayControl::ShowProgress(bool Initial) bool cReplayControl::ShowProgress(bool Initial)
{ {
int Current, Total; int Current, Total;
if (!(Initial || updateTimer.TimedOut()))
return visible;
if (GetFrameNumber(Current, Total) && Total > 0) { if (GetFrameNumber(Current, Total) && Total > 0) {
if (!visible) { if (!visible) {
displayReplay = Skins.Current()->DisplayReplay(modeOnly); displayReplay = Skins.Current()->DisplayReplay(modeOnly);
@ -5762,6 +5765,7 @@ bool cReplayControl::ShowProgress(bool Initial)
} }
lastTotal = Total; lastTotal = Total;
ShowMode(); ShowMode();
updateTimer.Set(PROGRESSTIMEOUT);
return true; return true;
} }
return false; return false;

3
menu.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.h 4.7 2018/04/02 13:41:49 kls Exp $ * $Id: menu.h 4.8 2018/04/14 10:24:41 kls Exp $
*/ */
#ifndef __MENU_H #ifndef __MENU_H
@ -300,6 +300,7 @@ private:
bool lastPlay, lastForward; bool lastPlay, lastForward;
int lastSpeed; int lastSpeed;
time_t timeoutShow; time_t timeoutShow;
cTimeMs updateTimer;
bool timeSearchActive, timeSearchHide; bool timeSearchActive, timeSearchHide;
int timeSearchTime, timeSearchPos; int timeSearchTime, timeSearchPos;
void TimeSearchDisplay(void); void TimeSearchDisplay(void);