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

While replaying, the editing marks are now updated every 10 seconds

This commit is contained in:
Klaus Schmidinger 2011-02-27 13:40:43 +01:00
parent cd3c26b815
commit 61c6b36bbc
5 changed files with 35 additions and 8 deletions

View File

@ -2575,6 +2575,8 @@ Manuel Reimer <Manuel.Reimer@gmx.de>
for fixing saving terminal settings when running in background
for making the SVDRP port open only for the local host if svdrphosts.conf
contains only the address of the local host
for a patch that was used as a base for making editing marks be updated every 10
seconds during replay
Rene van den Braken <rene@vandenbraken.name>
for reporting a bug in writing the PCR pid into the PMT in

View File

@ -6545,3 +6545,5 @@ Video Disk Recorder Revision History
(thanks to Anssi Hannula).
- Changed the compiler optimization flag to -O3, which gives quite a performance
boost in the AlphaBlend() function.
- While replaying, the editing marks are now updated every 10 seconds (based on a
patch from Manuel Reimer).

4
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 2.27 2011/02/26 15:28:32 kls Exp $
* $Id: menu.c 2.28 2011/02/27 12:37:48 kls Exp $
*/
#include "menu.h"
@ -4742,6 +4742,8 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
{
if (!Active())
return osEnd;
if (Key == kNone)
marks.Update();
if (visible) {
if (timeoutShow && time(NULL) > timeoutShow) {
Hide();

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 2.25 2011/02/25 14:35:19 kls Exp $
* $Id: recording.c 2.26 2011/02/27 13:35:20 kls Exp $
*/
#include "recording.h"
@ -57,6 +57,7 @@
#define DELETEDLIFETIME 300 // seconds after which a deleted recording will be actually removed
#define DISKCHECKDELTA 100 // seconds between checks for free disk space
#define REMOVELATENCY 10 // seconds to wait until next check after removing a file
#define MARKSUPDATEDELTA 10 // seconds between checks for updating editing marks
#define MAX_SUBTITLE_LENGTH 40
@ -1267,12 +1268,28 @@ bool cMark::Save(FILE *f)
bool cMarks::Load(const char *RecordingFileName, double FramesPerSecond, bool IsPesRecording)
{
cMutexLock MutexLock(&MutexMarkFramesPerSecond);
fileName = AddDirectory(RecordingFileName, IsPesRecording ? MARKSFILESUFFIX ".vdr" : MARKSFILESUFFIX);
framesPerSecond = FramesPerSecond;
MarkFramesPerSecond = framesPerSecond;
if (cConfig<cMark>::Load(AddDirectory(RecordingFileName, IsPesRecording ? MARKSFILESUFFIX ".vdr" : MARKSFILESUFFIX))) {
Sort();
return true;
lastUpdate = 0;
lastFileTime = -1; // the first call to Load() must take place!
return Update();
}
bool cMarks::Update(void)
{
time_t t = time(NULL);
if (t - lastUpdate > MARKSUPDATEDELTA) {
lastUpdate = t;
t = LastModifiedTime(fileName);
if (t > lastFileTime) {
lastFileTime = t;
cMutexLock MutexLock(&MutexMarkFramesPerSecond);
MarkFramesPerSecond = framesPerSecond;
if (cConfig<cMark>::Load(fileName)) {
Sort();
return true;
}
}
}
return false;
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.h 2.15 2010/12/27 10:48:21 kls Exp $
* $Id: recording.h 2.16 2011/02/27 12:48:21 kls Exp $
*/
#ifndef __RECORDING_H
@ -190,9 +190,13 @@ public:
class cMarks : public cConfig<cMark> {
private:
cString fileName;
double framesPerSecond;
time_t lastUpdate;
time_t lastFileTime;
public:
bool Load(const char *RecordingFileName, double FramesPerSecond = DEFAULTFRAMESPERSECOND, bool IsPesRecording = false);
bool Update(void);
void Sort(void);
cMark *Add(int Position);
cMark *Get(int Position);