From c23522ade253e23b5bf6141d7d7e7335d6abcd1d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 8 May 2005 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.24=20-=20Now=20including=20the=20optional?= =?UTF-8?q?=20user=20defined=20Make.config=20from=20the=20'libsi'=20Makefi?= =?UTF-8?q?le=20=20=20(thanks=20to=20Ville=20Skytt=C3=A4).=20-=20Updated?= =?UTF-8?q?=20the=20Danish=20OSD=20texts=20(thanks=20to=20Mogens=20Elneff)?= =?UTF-8?q?.=20-=20Fixed=20a=20memory=20leak=20in=20tComponent=20(thanks?= =?UTF-8?q?=20to=20Stefan=20Huelswitt=20and=20Daniel=20Thompson).=20-=20Fi?= =?UTF-8?q?xed=20a=20memory=20leak=20in=20cDvbPlayer=20(thanks=20to=20Stef?= =?UTF-8?q?an=20Huelswitt).=20-=20Added=20missing=20text=20internationaliz?= =?UTF-8?q?ation=20for=20"Starting=20EPG=20scan"=20(thanks=20to=20=20=20Ma?= =?UTF-8?q?tthias=20L=C3=B6tzke).=20-=20Updated=20the=20Finnish=20OSD=20te?= =?UTF-8?q?xts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20handling?= =?UTF-8?q?=20transparent=20areas=20in=20cDvbSpuBitmap=20(thanks=20to=20Ma?= =?UTF-8?q?rco=20Schl=C3=BC=C3=9Fler).=20-=20Now=20also=20considering=20th?= =?UTF-8?q?e=20"EPG=20linger=20time"=20when=20saving=20the=20EPG=20data=20?= =?UTF-8?q?to=20file=20or=20=20=20listing=20it=20via=20LSTE=20(thanks=20to?= =?UTF-8?q?=20Roman=20Krenick=C3=BD).=20-=20Fixed=20handling=20fragments?= =?UTF-8?q?=20of=20less=20than=204=20byte=20in=20cPesAssembler=20(thanks?= =?UTF-8?q?=20to=20=20=20Reinhard=20Nissl).=20-=20Fixed=20a=20bug=20in=20l?= =?UTF-8?q?ibsi's=20SubtitlingDescriptor::getLength()=20(thanks=20to=20Mar?= =?UTF-8?q?co=20=20=20Schl=C3=BC=C3=9Fler).=20-=20When=20reading=20the=20c?= =?UTF-8?q?hannels.conf=20file,=20duplicate=20channels=20(i.e.=20ones=20th?= =?UTF-8?q?at=20have=20=20=20the=20same=20channel=20ID)=20are=20now=20auto?= =?UTF-8?q?matically=20deleted=20and=20only=20the=20first=20one=20is=20=20?= =?UTF-8?q?=20actually=20stored.=20-=20Fixed=20handling=20lifetime=20when?= =?UTF-8?q?=20deciding=20whether=20to=20delete=20a=20recording=20(thanks?= =?UTF-8?q?=20to=20=20=20Udo=20Richter).=20-=20Fixed=20timeout=20handling?= =?UTF-8?q?=20in=20cRwLock::Lock()=20(thanks=20to=20Sascha=20Volkenandt=20?= =?UTF-8?q?for=20reporting=20=20=20this=20one).=20-=20Since=20there=20are?= =?UTF-8?q?=20several=20places=20in=20thread.c=20where=20a=20timeout=20val?= =?UTF-8?q?ue=20is=20calculated,=20=20=20this=20has=20been=20put=20into=20?= =?UTF-8?q?a=20separate=20function.=20-=20The=20timer=20status=20now=20has?= =?UTF-8?q?=20a=20new=20bit=20that=20is=20set=20when=20that=20timer=20is?= =?UTF-8?q?=20currently=20=20=20recording=20(suggested=20by=20Matthias=20S?= =?UTF-8?q?chniedermeyer).=20See=20man=20vdr(5)=20for=20details.=20-=20Rem?= =?UTF-8?q?oved=20scaling=20coordinates=20in=20letterbox=20mode=20from=20c?= =?UTF-8?q?DvbSpu=20-=20the=20DVD=20plugin,=20which=20=20=20was=20the=20on?= =?UTF-8?q?ly=20one=20needing=20this,=20doesn't=20need=20it=20any=20more?= =?UTF-8?q?=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20No=20long?= =?UTF-8?q?er=20retuning=20or=20restarting=20a=20recording=20if=20only=20t?= =?UTF-8?q?he=20language=20code=20of=20an=20=20=20audio=20or=20Dolby=20PID?= =?UTF-8?q?=20changes.=20-=20Now=20preferring=20budget=20cards=20when=20se?= =?UTF-8?q?lecting=20a=20DVB=20device=20for=20recording.=20-=20Recordings?= =?UTF-8?q?=20now=20avoid=20zero=20sized=20video=20data=20files=20(thanks?= =?UTF-8?q?=20to=20Wolfgang=20Fitz).=20-=20Some=20rearrangements=20in=20cD?= =?UTF-8?q?vbPlayer::Action()=20to=20avoid=20lockups=20on=20NPTL=20systems?= =?UTF-8?q?=20=20=20(thanks=20to=20Reinhard=20Nissl).=20-=20Fixed=20a=20wr?= =?UTF-8?q?ong=20inheritance=20in=20libsi's=20SubtitlingDescriptor::Subtit?= =?UTF-8?q?ling=20(thanks=20to=20=20=20Marco=20Schl=C3=BC=C3=9Fler).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- recording.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'recording.c') diff --git a/recording.c b/recording.c index e50dfcb..ed74c46 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 1.96 2005/02/12 10:17:47 kls Exp $ + * $Id: recording.c 1.98 2005/05/07 15:25:15 kls Exp $ */ #include "recording.h" @@ -126,7 +126,7 @@ void AssertFreeDiskSpace(int Priority) while (r) { if (!r->IsEdited() && r->lifetime < MAXLIFETIME) { // edited recordings and recordings with MAXLIFETIME live forever if ((r->lifetime == 0 && Priority > r->priority) || // the recording has no guaranteed lifetime and the new recording has higher priority - (time(NULL) - r->start) / SECSINDAY > r->lifetime) { // the recording's guaranteed lifetime has expired + (r->lifetime > 0 && (time(NULL) - r->start) / SECSINDAY >= r->lifetime)) { // the recording's guaranteed lifetime has expired if (r0) { if (r->priority < r0->priority || (r->priority == r0->priority && r->start < r0->start)) r0 = r; // in any case we delete the one with the lowest priority (or the older one in case of equal priorities) @@ -1124,8 +1124,21 @@ int cFileName::SetOffset(int Number, int Offset) fileNumber = Number; sprintf(pFileNumber, RECORDFILESUFFIX, fileNumber); if (record) { - if (access(fileName, F_OK) == 0) // file exists, let's try next suffix - return SetOffset(Number + 1); + if (access(fileName, F_OK) == 0) { + // files exists, check if it has non-zero size + struct stat buf; + if (stat(fileName, &buf) == 0) { + if (buf.st_size != 0) + return SetOffset(Number + 1); // file exists and has non zero size, let's try next suffix + else { + // zero size file, remove it + dsyslog ("cFileName::SetOffset: removing zero-sized file %s\n", fileName); + unlink (fileName); + } + } + else + return SetOffset(Number + 1); // error with fstat - should not happen, just to be on the safe side + } else if (errno != ENOENT) { // something serious has happened LOG_ERROR_STR(fileName); return -1; -- cgit v1.2.3