From patchwork Mon Jun 4 12:41:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12955 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SbWb1-0006wE-JL for vdr@linuxtv.org; Mon, 04 Jun 2012 14:41:20 +0200 X-tubIT-Incoming-IP: 188.40.50.18 Received: from racoon.tvdr.de ([188.40.50.18]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtps [TLSv1:AES256-SHA:256] for id 1SbWb1-00077s-E8; Mon, 04 Jun 2012 14:41:19 +0200 Received: from dolphin.tvdr.de (dolphin.tvdr.de [192.168.100.2]) by racoon.tvdr.de (8.14.3/8.14.3) with ESMTP id q54CfxBC001638 for ; Mon, 4 Jun 2012 14:41:59 +0200 Received: from [192.168.100.10] (hawk.tvdr.de [192.168.100.10]) by dolphin.tvdr.de (8.14.4/8.14.4) with ESMTP id q54CfCoN007310 for ; Mon, 4 Jun 2012 14:41:12 +0200 Message-ID: <4FCCACE8.8070302@tvdr.de> Date: Mon, 04 Jun 2012 14:41:12 +0200 From: Klaus Schmidinger User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120421 Thunderbird/12.0 MIME-Version: 1.0 To: vdr@linuxtv.org References: <4FCB4008.3050000@tvdr.de> In-Reply-To: <4FCB4008.3050000@tvdr.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (racoon.tvdr.de [188.40.50.18]); Mon, 04 Jun 2012 14:41:59 +0200 (CEST) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.6.4.123316 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_5000_5999 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793 autolearn=no Subject: Re: [vdr] [ANNOUNCE] VDR developer version 1.7.28 - supplemental X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 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, 04 Jun 2012 12:41:20 -0000 Status: O X-Status: X-Keywords: X-UID: 26340 On 03.06.2012 12:44, Klaus Schmidinger wrote: > VDR developer version 1.7.28 is now available at > > ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.28.tar.bz2 > > A 'diff' against the previous version is available at > > ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.27-1.7.28.diff > > ... > The changes since version 1.7.27: > > ... > - Added DeleteEvent() to the EPG handler interface, so that an EPG handler can trigger > deleting of an event (thanks to Christian Kaiser). This change has shown not to be as useful es expected. It will therefore be revoked in version 1.7.29 and replaced with HandledExternally(). I'm posting the attached patch from Jörg Wendel as a preview of version 1.7.29 to make sure nobody uses the obsolete DeleteEvents() function. Klaus --- ./eit.c 2012/06/02 14:05:22 2.17 +++ ./eit.c 2012/06/04 10:10:11 @@ -45,6 +45,7 @@ return; } + bool handledExternally = EpgHandlers.HandledExternally(channel); cSchedule *pSchedule = (cSchedule *)Schedules->GetSchedule(channel, true); bool Empty = true; @@ -70,7 +71,7 @@ cEvent *newEvent = NULL; cEvent *rEvent = NULL; cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), StartTime); - if (!pEvent) { + if (!pEvent || handledExternally) { if (OnlyRunningStatus) continue; // If we don't have that event yet, we create a new one. @@ -78,7 +79,8 @@ pEvent = newEvent = new cEvent(SiEitEvent.getEventId()); newEvent->SetStartTime(StartTime); newEvent->SetDuration(Duration); - pSchedule->AddEvent(newEvent); + if (!handledExternally) + pSchedule->AddEvent(newEvent); } else { // We have found an existing event, either through its event ID or its start time. @@ -290,11 +292,8 @@ channel->SetLinkChannels(LinkChannels); Modified = true; EpgHandlers.HandleEvent(pEvent); - - if (EpgHandlers.DeleteEvent(pEvent)) { - pSchedule->DelEvent(pEvent); - pEvent = NULL; - } + if (handledExternally) + delete pEvent; } if (Tid == 0x4E) { if (Empty && getSectionNumber() == 0) --- ./epg.c 2012/06/02 14:08:12 2.14 +++ ./epg.c 2012/06/04 10:06:22 @@ -1331,6 +1331,15 @@ return false; } +bool cEpgHandlers::HandledExternally(const cChannel *Channel) +{ + for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { + if (eh->HandledExternally(Channel)) + return true; + } + return false; +} + void cEpgHandlers::SetEventID(cEvent *Event, tEventID EventID) { for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { @@ -1429,15 +1438,6 @@ } } -bool cEpgHandlers::DeleteEvent(const cEvent *Event) -{ - for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { - if (eh->DeleteEvent(Event)) - return true; - } - return false; -} - void cEpgHandlers::SortSchedule(cSchedule *Schedule) { for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { --- ./epg.h 2012/06/02 14:07:51 2.10 +++ ./epg.h 2012/06/04 10:05:21 @@ -244,6 +244,12 @@ ///< EPG handlers are queried to see if any of them would like to do the ///< complete processing by itself. TableID and Version are from the ///< incoming section data. + virtual bool HandledExternally(const cChannel *Channel) { return false; } + ///< If any EPG handler returns true in this function, it is assumed that + ///< the EPG for the given Channel is handled completely from some external + ///< source. Incoming EIT data is processed as usual, but any new EPG event + ///< will not be added to the respective schedule. It's up to the EPG + ///< handler to take care of this. virtual bool SetEventID(cEvent *Event, tEventID EventID) { return false; } virtual bool SetTitle(cEvent *Event, const char *Title) { return false; } virtual bool SetShortText(cEvent *Event, const char *ShortText) { return false; } @@ -258,9 +264,6 @@ virtual bool HandleEvent(cEvent *Event) { return false; } ///< After all modifications of the Event have been done, the EPG handler ///< can take a final look at it. - virtual bool DeleteEvent(const cEvent *Event) { return false; } - ///< After the complete processing of the Event is finished, an EPG handler - ///< can decide that this Event shall be deleted from its schedule. virtual bool SortSchedule(cSchedule *Schedule) { return false; } ///< Sorts the Schedule after the complete table has been processed. virtual bool DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version) { return false; } @@ -272,6 +275,7 @@ public: bool IgnoreChannel(const cChannel *Channel); bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version); + bool HandledExternally(const cChannel *Channel); void SetEventID(cEvent *Event, tEventID EventID); void SetTitle(cEvent *Event, const char *Title); void SetShortText(cEvent *Event, const char *ShortText); @@ -283,7 +287,6 @@ void SetVps(cEvent *Event, time_t Vps); void FixEpgBugs(cEvent *Event); void HandleEvent(cEvent *Event); - bool DeleteEvent(const cEvent *Event); void SortSchedule(cSchedule *Schedule); void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version); };