From patchwork Sun Sep 11 15:07:59 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carsten Koch X-Patchwork-Id: 12017 Received: from melpumpe.icem.de ([158.225.1.2] helo=mail.icem.de) by www.linuxtv.org with esmtp (Exim 4.34) id 1EETRq-0005N2-4E for vdr@linuxtv.org; Sun, 11 Sep 2005 17:08:50 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.icem.de (Postfix) with ESMTP id DD80C125CBF for ; Sun, 11 Sep 2005 17:08:19 +0200 (CEST) Received: from mail.icem.de ([127.0.0.1]) by localhost (melpumpe [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32704-10; Sun, 11 Sep 2005 17:08:17 +0200 (CEST) Received: from [192.168.25.1] (wald1.icemnet.de [192.168.25.1]) by mail.icem.de (Postfix) with ESMTP id 7A25B125BBD for ; Sun, 11 Sep 2005 17:08:16 +0200 (CEST) Message-ID: <4324484F.3010806@icem.com> Date: Sun, 11 Sep 2005 17:07:59 +0200 From: Carsten Koch User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Video Disk Recorder Mailing List X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at icem.com Subject: [vdr] DeleteResume patch for vdr 1.3.32. X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2005 15:08:50 -0000 Status: O X-Status: X-Keywords: X-UID: 4867 The attached patch lets VDR remove a resume.vdr instead of storing a position in it that points to the beginning. In big collections of recordings, this reduces the time to create/update the recordings menu quite a bit, since VDR does not have to open hundreds of files just to find out that the information in them is a non-information. After this patch has made it into standard VDR, the performance of the recordings menu can be further enhanced by *never* reading the file, not even when it does exist, since with the attached patch it is clear that an existing resume.vdr always means the recording is not rewound. diff -ur vdr-1.3.32/recording.c vdr-1.3.32+DeleteResume/recording.c --- vdr-1.3.32/recording.c 2005-09-10 14:36:48.000000000 +0200 +++ vdr-1.3.32+DeleteResume/recording.c 2005-09-11 16:58:01.440552360 +0200 @@ -194,13 +194,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; } Only in vdr-1.3.32+DeleteResume: recording.c.orig