summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2011-04-17 16:50:00 +0200
committerKlaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de>2011-04-17 17:09:00 +0200
commit8b9350c091bc5ae8c9bb30b83a1fb567c3a7cb7f (patch)
tree51880b55c64c719561524fa4721d933b9205656e /recording.c
parent5619c0602bc623adeddf3385ada8c742aaea9762 (diff)
downloadvdr-patches-8b9350c091bc5ae8c9bb30b83a1fb567c3a7cb7f.tar.gz
vdr-patches-8b9350c091bc5ae8c9bb30b83a1fb567c3a7cb7f.tar.bz2
Version 1.7.18
- Changed -O2 to -O3 in Make.config.template (reported by Matti Lehtimäki). - Added a missing 'default' case in cPixmapMemory::DrawEllipse(). - Fixed some direct comparisons of double values. - Fixed detecting frames on channels that broadcast with separate "fields" instead of complete frames. - Made updating the editing marks during replay react faster in case the marks file has just been written (with a patch from Udo Richter). - Fixed horizontal scaling of subtitles (reported by Reinhard Nissl). - 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 is now used to properly scale subtitles. - Fixed cUnbufferedFile::Seek() in case it is compiled without USE_FADVISE (thanks to Juergen Lock). - Fixed the Language header of the Serbian translation file (thanks to Ville Skyttä). - Added anti-aliasing when upscaling bitmaps, which improves the display of SD subtitles when replayed on an HD OSD (thanks to Reinhard Nissl for his help in debugging). - Renamed cBitmap::Scale() to Scaled(), because it doesn't modify the bitmap itself, but rather returns a scaled copy. - Fixed the description of cReceiver in PLUGINS.html, regarding detaching a receiver from its device before deleting it (reported by Winfried Köhler). This change in behavior was introduced in version 1.5.7. - Fixed scaling subtitles in case the OSD size is exactly the same as the display size of the subtitles. - Added a missing initialization to sDvbSpuRect (reported by Sergiu Dotenco). - Replaced "%lld" and "%llX" print format specifiers with "PRId64" and "PRIX64" to avoid compiler warnings with gcc 4.5.2 (thanks to Sergiu Dotenco). On a personal note: I find it a step in the totally wrong direction that there have been macros introduced to work around this problem in the first place. There should have been "real" format specifiers defined that address this. These macros are nothing but an ugly workaround. - Added Cancel(3) to ~cTrueColorDemo() in the "osddemo" plugin (thanks to Reinhard Nissl). - Added a missing font deletion in cTrueColorDemo::Action() in the "osddemo" plugin (thanks to Reinhard Nissl). - Fixed a buffer overflow in cFont::Bidi() (thanks to Reinhard Nissl). - Added HD stream content identifiers to vdr.5 (thanks to Christoph Haubrich). - Made cRecordingInfo::Read(FILE *f) private to avoid calls to it from outside cRecordingInfo or cRecording (reported by Mika Laitio). - The dvbhddevice plugin is now part of the VDR distribution archive (thanks to Andreas Regel). - Removed an obsolete local variable in dvbsdffosd.c (thanks to Paul Menzel). - Fixed a possible NULL pointer dereference in osddemo.c (reported by Paul Menzel). - Now using pkg-config to get fribidi, freetype and fontconfig cflags and libs (thanks to Ville Skyttä). - The Makefile now also installs the include files (thanks to Ville Skyttä). - Added handling of "ANSI/SCTE 57" descriptors (thanks too Rolf Ahrenberg). - Avoiding an unecessary call to Recordings.ResetResume() (thanks to Reinhard Nissl).
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/recording.c b/recording.c
index 02a6e61..d4cf9c3 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 2.26 2011/02/27 13:35:20 kls Exp $
+ * $Id: recording.c 2.30 2011/04/17 13:53:11 kls Exp $
*/
#include "recording.h"
@@ -12,6 +12,8 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#define __STDC_FORMAT_MACROS // Required for format specifiers
+#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
@@ -301,9 +303,10 @@ bool cResumeFile::Save(int Index)
void cResumeFile::Delete(void)
{
if (fileName) {
- if (remove(fileName) < 0 && errno != ENOENT)
+ if (remove(fileName) == 0)
+ Recordings.ResetResume(fileName);
+ else if (errno != ENOENT)
LOG_ERROR_STR(fileName);
- Recordings.ResetResume(fileName);
}
}
@@ -1270,19 +1273,31 @@ bool cMarks::Load(const char *RecordingFileName, double FramesPerSecond, bool Is
{
fileName = AddDirectory(RecordingFileName, IsPesRecording ? MARKSFILESUFFIX ".vdr" : MARKSFILESUFFIX);
framesPerSecond = FramesPerSecond;
- lastUpdate = 0;
+ nextUpdate = 0;
lastFileTime = -1; // the first call to Load() must take place!
+ lastChange = 0;
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;
+ if (t > nextUpdate) {
+ time_t LastModified = LastModifiedTime(fileName);
+ if (LastModified != lastFileTime) // change detected, or first run
+ lastChange = LastModified > 0 ? LastModified : t;
+ int d = t - lastChange;
+ if (d < 60)
+ d = 1; // check frequently if the file has just been modified
+ else if (d < 3600)
+ d = 10; // older files are checked less frequently
+ else
+ d /= 360; // phase out checking for very old files
+ nextUpdate = t + d;
+ if (LastModified != lastFileTime) { // change detected, or first run
+ lastFileTime = LastModified;
+ if (lastFileTime == t)
+ lastFileTime--; // make sure we don't miss updates in the remaining second
cMutexLock MutexLock(&MutexMarkFramesPerSecond);
MarkFramesPerSecond = framesPerSecond;
if (cConfig<cMark>::Load(fileName)) {
@@ -1550,7 +1565,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record, bool IsPesRecording)
delta = int(buf.st_size % sizeof(tIndexTs));
if (delta) {
delta = sizeof(tIndexTs) - delta;
- esyslog("ERROR: invalid file size (%lld) in '%s'", buf.st_size, fileName);
+ esyslog("ERROR: invalid file size (%"PRId64") in '%s'", buf.st_size, fileName);
}
last = int((buf.st_size + delta) / sizeof(tIndexTs) - 1);
if (!Record && last >= 0) {