Getting rid of redundant resume.vdr files.
Commit Message
Carsten Koch wrote:
...
> Attached is an updated version of my patch for VDR 1.3.30.
at least now it is. ;-)
@@ -199,13 +199,19 @@
bool cResumeFile::Save(int Index)
{
if (fileName) {
- int f = open(fileName, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE);
- if (f >= 0) {
- if (safe_write(f, &Index, sizeof(Index)) < 0)
- LOG_ERROR_STR(fileName);
- close(f);
- return true;
- }
+ if (Index / FRAMESPERSEC < 60) {
+ Delete();
+ return true;
+ }
+ else {
+ int f = open(fileName, O_WRONLY | O_CREAT | O_TRUNC, DEFFILEMODE);
+ if (f >= 0) {
+ if (safe_write(f, &Index, sizeof(Index)) < 0)
+ LOG_ERROR_STR(fileName);
+ close(f);
+ return true;
+ }
+ }
}
return false;
}