diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2018-04-03 08:00:12 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2018-04-03 08:00:12 +0200 |
commit | 43544435fa0083f2187f4388e442d87b3b954073 (patch) | |
tree | 939695472273ed2e73ca1c1bbcaa40eba54a551c /menu.c | |
parent | ac30924cdfe0029a3b148b7808d5b0dc453ee8ac (diff) | |
download | vdr-43544435fa0083f2187f4388e442d87b3b954073.tar.gz vdr-43544435fa0083f2187f4388e442d87b3b954073.tar.bz2 |
Fixed sluggish setting of editing marks and a jumping progress display with very short recordings
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 66 |
1 files changed, 28 insertions, 38 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 4.70 2018/03/24 11:43:40 kls Exp $ + * $Id: menu.c 4.71 2018/04/02 13:41:39 kls Exp $ */ #include "menu.h" @@ -5564,7 +5564,6 @@ cReplayControl::cReplayControl(bool PauseLive) lastPlay = lastForward = false; lastSpeed = -2; // an invalid value timeoutShow = 0; - lastProgressUpdate = 0; timeSearchActive = false; cRecording Recording(fileName); cStatus::MsgReplaying(this, Recording.Name(), Recording.FileName(), true); @@ -5728,43 +5727,36 @@ void cReplayControl::ShowMode(void) bool cReplayControl::ShowProgress(bool Initial) { int Current, Total; - if (Initial || lastSpeed != -1 || time(NULL) - lastProgressUpdate >= 1) { - if (GetFrameNumber(Current, Total) && Total > 0) { - if (!visible) { - displayReplay = Skins.Current()->DisplayReplay(modeOnly); - displayReplay->SetMarks(&marks); - SetNeedsFastResponse(true); - visible = true; - } - if (Initial) { - if (*fileName) { - LOCK_RECORDINGS_READ; - if (const cRecording *Recording = Recordings->GetByName(fileName)) - displayReplay->SetRecording(Recording); - } - lastCurrent = lastTotal = -1; + if (GetFrameNumber(Current, Total) && Total > 0) { + if (!visible) { + displayReplay = Skins.Current()->DisplayReplay(modeOnly); + displayReplay->SetMarks(&marks); + SetNeedsFastResponse(true); + visible = true; + } + if (Initial) { + if (*fileName) { + LOCK_RECORDINGS_READ; + if (const cRecording *Recording = Recordings->GetByName(fileName)) + displayReplay->SetRecording(Recording); } - if (Current != lastCurrent || Total != lastTotal) { - time(&lastProgressUpdate); - if (Setup.ShowRemainingTime || Total != lastTotal) { - int Index = Total; - if (Setup.ShowRemainingTime) - Index = Current - Index; - displayReplay->SetTotal(IndexToHMSF(Index, false, FramesPerSecond())); - if (!Initial) - displayReplay->Flush(); - } - displayReplay->SetProgress(Current, Total); - if (!Initial) - displayReplay->Flush(); - displayReplay->SetCurrent(IndexToHMSF(Current, displayFrames, FramesPerSecond())); - displayReplay->Flush(); - lastCurrent = Current; + lastCurrent = lastTotal = -1; + } + if (Current != lastCurrent || Total != lastTotal) { + if (Setup.ShowRemainingTime || Total != lastTotal) { + int Index = Total; + if (Setup.ShowRemainingTime) + Index = Current - Index; + displayReplay->SetTotal(IndexToHMSF(Index, false, FramesPerSecond())); } - lastTotal = Total; - ShowMode(); - return true; + displayReplay->SetProgress(Current, Total); + displayReplay->SetCurrent(IndexToHMSF(Current, displayFrames, FramesPerSecond())); + displayReplay->Flush(); + lastCurrent = Current; } + lastTotal = Total; + ShowMode(); + return true; } return false; } @@ -6007,8 +5999,6 @@ eOSState cReplayControl::ProcessKey(eKeys Key) return osEnd; if (Key == kNone && !marksModified) marks.Update(); - if (Key != kNone) - lastProgressUpdate = 0; if (visible) { if (timeoutShow && time(NULL) > timeoutShow) { Hide(); |