From 8d8dd8ecbd3a7c95800921009c72123939e3e571 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 4 Jun 2012 10:19:23 +0200 Subject: Added HandledExternally() to the EPG handler interface --- eit.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'eit.c') diff --git a/eit.c b/eit.c index c746337b..9840d9a2 100644 --- a/eit.c +++ b/eit.c @@ -8,7 +8,7 @@ * Robert Schneider and Rolf Hakenes . * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg . * - * $Id: eit.c 2.18 2012/06/04 09:48:57 kls Exp $ + * $Id: eit.c 2.19 2012/06/04 10:10:11 kls Exp $ */ #include "eit.h" @@ -45,6 +45,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo return; } + bool handledExternally = EpgHandlers.HandledExternally(channel); cSchedule *pSchedule = (cSchedule *)Schedules->GetSchedule(channel, true); bool Empty = true; @@ -70,7 +71,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo 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 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo 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,6 +292,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo channel->SetLinkChannels(LinkChannels); Modified = true; EpgHandlers.HandleEvent(pEvent); + if (handledExternally) + delete pEvent; } if (Tid == 0x4E) { if (Empty && getSectionNumber() == 0) -- cgit v1.2.3