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

Added a patch from Udo Richter

This commit is contained in:
Klaus Schmidinger 2011-04-17 13:22:44 +02:00
parent 8e3c9f553f
commit 5138ccc1ce
4 changed files with 13 additions and 14 deletions

View File

@ -1691,6 +1691,8 @@ Udo Richter <udo_richter@gmx.de>
for reporting missing defines for large files in the 'newplugin' script for reporting missing defines for large files in the 'newplugin' script
for pointing out that the full timer file name should be displayed if it ends with for pointing out that the full timer file name should be displayed if it ends with
"TITLE" or "EPISODE" "TITLE" or "EPISODE"
for a patch to "Made updating the editing marks during replay react faster in case
the marks file has just been written"
Sven Kreiensen <svenk@kammer.uni-hannover.de> Sven Kreiensen <svenk@kammer.uni-hannover.de>
for his help in keeping 'channels.conf.terr' up to date for his help in keeping 'channels.conf.terr' up to date

View File

@ -6565,7 +6565,7 @@ Video Disk Recorder Revision History
- Fixed detecting frames on channels that broadcast with separate "fields" instead - Fixed detecting frames on channels that broadcast with separate "fields" instead
of complete frames. of complete frames.
- Made updating the editing marks during replay react faster in case the marks - Made updating the editing marks during replay react faster in case the marks
file has just been written. file has just been written (with a patch from Udo Richter).
- Fixed horizontal scaling of subtitles (reported by Reinhard Nissl). - Fixed horizontal scaling of subtitles (reported by Reinhard Nissl).
- Stripped the note "The data returned by this function is only used for informational - Stripped the note "The data returned by this function is only used for informational
purposes (if any)" from the description of cDevice::GetVideoSize(). The VideoAspect purposes (if any)" from the description of cDevice::GetVideoSize(). The VideoAspect

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: recording.c 2.28 2011/03/27 15:02:53 kls Exp $ * $Id: recording.c 2.29 2011/04/17 13:20:46 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -1274,6 +1274,7 @@ bool cMarks::Load(const char *RecordingFileName, double FramesPerSecond, bool Is
framesPerSecond = FramesPerSecond; framesPerSecond = FramesPerSecond;
nextUpdate = 0; nextUpdate = 0;
lastFileTime = -1; // the first call to Load() must take place! lastFileTime = -1; // the first call to Load() must take place!
lastChange = 0;
return Update(); return Update();
} }
@ -1282,16 +1283,9 @@ bool cMarks::Update(void)
time_t t = time(NULL); time_t t = time(NULL);
if (t > nextUpdate) { if (t > nextUpdate) {
time_t LastModified = LastModifiedTime(fileName); time_t LastModified = LastModifiedTime(fileName);
int d; if (LastModified != lastFileTime) // change detected, or first run
if (LastModified > 0) // the file exists lastChange = LastModified > 0 ? LastModified : t;
d = t - LastModified; int d = t - lastChange;
else { // the file doesn't exist
if (lastFileTime <= 0) {
lastFileTime = t - 2; // -2 makes sure we don't miss an update within the very same second
LastModified = t; // make sure we run into the actual Load() below
}
d = t - lastFileTime;
}
if (d < 60) if (d < 60)
d = 1; // check frequently if the file has just been modified d = 1; // check frequently if the file has just been modified
else if (d < 3600) else if (d < 3600)
@ -1299,8 +1293,10 @@ bool cMarks::Update(void)
else else
d /= 360; // phase out checking for very old files d /= 360; // phase out checking for very old files
nextUpdate = t + d; nextUpdate = t + d;
if (LastModified > lastFileTime) { if (LastModified != lastFileTime) { // change detected, or first run
lastFileTime = LastModified; lastFileTime = LastModified;
if (lastFileTime == t)
lastFileTime--; // make sure we don't miss updates in the remaining second
cMutexLock MutexLock(&MutexMarkFramesPerSecond); cMutexLock MutexLock(&MutexMarkFramesPerSecond);
MarkFramesPerSecond = framesPerSecond; MarkFramesPerSecond = framesPerSecond;
if (cConfig<cMark>::Load(fileName)) { if (cConfig<cMark>::Load(fileName)) {

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: recording.h 2.18 2011/04/03 11:14:37 kls Exp $ * $Id: recording.h 2.19 2011/04/17 13:18:04 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -194,6 +194,7 @@ private:
double framesPerSecond; double framesPerSecond;
time_t nextUpdate; time_t nextUpdate;
time_t lastFileTime; time_t lastFileTime;
time_t lastChange;
public: public:
bool Load(const char *RecordingFileName, double FramesPerSecond = DEFAULTFRAMESPERSECOND, bool IsPesRecording = false); bool Load(const char *RecordingFileName, double FramesPerSecond = DEFAULTFRAMESPERSECOND, bool IsPesRecording = false);
bool Update(void); bool Update(void);