From patchwork Mon May 22 19:42:50 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12315 Received: from mail.gmx.de ([213.165.64.20] helo=mail.gmx.net) by www.linuxtv.org with smtp (Exim 4.50) id 1FiGJL-0004IA-GU for vdr@linuxtv.org; Mon, 22 May 2006 21:43:27 +0200 Received: (qmail invoked by alias); 22 May 2006 19:42:53 -0000 Received: from p548A4932.dip0.t-ipconnect.de (EHLO [192.168.73.1]) [84.138.73.50] by mail.gmx.net (mp033) with SMTP; 22 May 2006 21:42:53 +0200 X-Authenticated: #1417946 Message-ID: <4472143A.7050206@gmx.de> Date: Mon, 22 May 2006 21:42:50 +0200 From: Udo Richter User-Agent: Thunderbird 2.0a1 (Windows/20060522) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] [Patch] Fix calculating starttime of repeated timers with start date References: <44705D02.7020505@gmx.de> <44706DAE.6030001@syphir.sytes.net> <44707B1E.5070204@gmx.de> <44707F20.7070303@syphir.sytes.net> <447087B4.1000302@syphir.sytes.net> <44708D03.6010609@gmx.de> <44708FC3.20404@syphir.sytes.net> <4470BD5F.10607@gmx.de> <447122E7.6030109@syphir.sytes.net> <447128D7.4040400@syphir.sytes.net> <4471EF75.2070609@gmx.de> <447205E7.8040308@gmx.net> In-Reply-To: <447205E7.8040308@gmx.net> X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 May 2006 19:43:27 -0000 Status: O X-Status: X-Keywords: X-UID: 9563 Andreas Brugger wrote: > Shouldn't Skip() actually skip to the next day, where the timer should > record and not to the day after? > I know the VDR's Skip() does not, but I think a "corrected" version > should or am I missing something here? Skip() sets the start day to the following day after StartTime(). Until now this was fine for VDR, because Skip() is only used for timers that have no start day set. For timers that have a start day, Skip() did weired things because of the sometimes wrong StartTime() for these timers. The original patch did not attempt to fix Skip(), it just fixes the wrong calculation of StartTime(). Skip() could be fixed by this additional patch: (untested!) However, with the original patch you can be quite sure that after Skip() the StartTime() will match the day mask, even if the start day does not. (and you can always set the start day to a non-recording day manually) A variant of the problematic loop in Enigma may be to Skip() until StartTime() instead of Day() matches the day mask - this should be instantly true with the patch, and will be true after some loops without the patch. (StartTime() however will then be falsely at midnight.) And add a failsafe that terminates after some 100 loops. ;) Cheers, Udo --- timers.c.orig 2006-05-20 18:50:49.000000000 +0200 +++ timers.c 2006-05-22 21:22:37.364563392 +0200 @@ -560,6 +560,7 @@ void cTimer::Skip(void) { day = IncDay(SetTime(StartTime(), 0), 1); + day = SetTime(StartTime(), 0); SetEvent(NULL); }