From 630ba21dc198e3fbf8c15c59f7ea852f7174c476 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 21 Nov 2004 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.17=20-=20Fixed=20cRemux::ScanVideoPacket(?= =?UTF-8?q?)=20to=20make=20sure=20it=20doesn't=20access=20memory=20beyond?= =?UTF-8?q?=20=20=20the=20end=20of=20the=20given=20buffer,=20which=20has?= =?UTF-8?q?=20caused=20some=20unjustified=20"unknown=20=20=20picture=20typ?= =?UTF-8?q?e=20errors"=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-?= =?UTF-8?q?=20Fixed=20a=20possible=20crash=20when=20pausing=20live=20video?= =?UTF-8?q?=20and=20the=20recording=20was=20unable=20=20=20to=20start,=20m?= =?UTF-8?q?aybe=20because=20there=20was=20no=20lock=20on=20the=20device=20?= =?UTF-8?q?(thanks=20to=20Andreas=20=20=20Brugger=20for=20reporting=20this?= =?UTF-8?q?=20one).=20-=20Fixed=20some=20characters=20in=20the=20iso8859-2?= =?UTF-8?q?=20font=20file=20(thanks=20to=20Dino=20Ravnic).=20-=20Fixed=20s?= =?UTF-8?q?ome=20errors=20in=20the=20Croatian=20language=20texts=20(thanks?= =?UTF-8?q?=20to=20Dino=20Ravnic).=20-=20Fixed=20a=20possible=20recursion?= =?UTF-8?q?=20in=20cControl::Shutdown()=20(thanks=20to=20Sascha=20Volkenan?= =?UTF-8?q?dt).=20-=20Now=20setting=20the=20VPID=20before=20the=20APID=20i?= =?UTF-8?q?n=20live=20mode=20to=20avoid=20unnecessary=20=20=20overhead=20i?= =?UTF-8?q?n=20the=20firmware=20(thanks=20to=20Werner=20Fink).=20-=20Now?= =?UTF-8?q?=20checking=20available=20OSD=20memory=20at=20runtime=20(thanks?= =?UTF-8?q?=20to=20Oliver=20Endriss).=20-=20Fixed=20some=20typos=20in=20th?= =?UTF-8?q?e=20Makefile's=20'font'=20target=20(thanks=20to=20Olaf=20Titz).?= =?UTF-8?q?=20-=20Fixed=20handling=20childTid=20in=20cThread=20to=20avoid?= =?UTF-8?q?=20possible=20race=20conditions=20(thanks=20=20=20to=20Stefan?= =?UTF-8?q?=20Huelswitt=20for=20pointing=20this=20out).=20-=20Fixed=20togg?= =?UTF-8?q?ling=20the=20"Day"=20item=20in=20the=20"Timers"=20menu,=20so=20?= =?UTF-8?q?that=20it=20selects=20the=20=20=20right=20day=20of=20week=20for?= =?UTF-8?q?=20timers=20in=20the=20future.=20-=20Some=20improvements=20to?= =?UTF-8?q?=20cPoller=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- timers.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'timers.c') diff --git a/timers.c b/timers.c index 501396e..62f59d8 100644 --- a/timers.c +++ b/timers.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 1.17 2004/11/14 16:02:42 kls Exp $ + * $Id: timers.c 1.18 2004/11/21 13:15:33 kls Exp $ */ #include "timers.h" @@ -269,6 +269,18 @@ int cTimer::GetWDay(time_t t) return weekday == 0 ? 6 : weekday - 1; // we start with monday==0! } +int cTimer::GetWDayFromMDay(int MDay) +{ + time_t now = time(NULL); + int md = GetMDay(now); + for (int i = -1; i <= 28; i++) { // looking 4 weeks into the future should be enough + time_t t0 = IncDay(now, i); + if (GetMDay(t0) == MDay) + return GetWDay(t0); + } + return GetWDay(now); // just to return something +} + bool cTimer::DayMatches(time_t t) const { return IsSingleEvent() ? GetMDay(t) == day : (day & (1 << GetWDay(t))) != 0; -- cgit v1.2.3