summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-10-21 17:11:08 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2012-10-21 17:11:08 (GMT)
commitec0ef17a51e2b357ef89e429fa0e0b69731cad77 (patch)
tree28a217b19de38284ecc7a15b787f53cb75a12f81
parentb08c994f7e1876b024902f59eea990c906850255 (diff)
parenta09e46d0dbeb29954f6ae72b95e00063455de0a2 (diff)
downloadvdr-plugin-eepg-ec0ef17a51e2b357ef89e429fa0e0b69731cad77.tar.gz
vdr-plugin-eepg-ec0ef17a51e2b357ef89e429fa0e0b69731cad77.tar.bz2
Merge branch 'ceit2' of ssh://192.168.1.138/home/dime/VDR/PLUGINS/src/eepg into ceit2
-rw-r--r--eit2.c2
-rw-r--r--util.c23
-rw-r--r--util.h2
3 files changed, 19 insertions, 8 deletions
diff --git a/eit2.c b/eit2.c
index 039172c..8d04486 100644
--- a/eit2.c
+++ b/eit2.c
@@ -574,7 +574,7 @@ cEIT2::cEIT2 (cSchedule * Schedule)
bool searchOtherSatPositions = Format == DISH_BEV;
- tChannelID channelID (Schedule->ChannelID().Source(), getOriginalNetworkId (), getTransportStreamId (), getServiceId ());
+ tChannelID channelID = Schedule->ChannelID();
channel = GetChannelByID (channelID, searchOtherSatPositions);
if (!channel) {
LogD(3, prep("!channel channelID: %s"), *channelID.ToString());
diff --git a/util.c b/util.c
index 640775a..9ca9484 100644
--- a/util.c
+++ b/util.c
@@ -121,7 +121,7 @@ void CleanString (unsigned char *String)
}
Src++;
}
- if (Spaces > 0 && String < Dst) {
+ if (Spaces > 0 && String && String < Dst) {
Dst--;
*Dst = 0;
} else {
@@ -176,25 +176,32 @@ cAddEventThread::~cAddEventThread(void)
void cAddEventThread::Action(void)
{
+ LogD (0, prep("Action"));
SetPriority(19);
while (Running() && !LastHandleEvent.TimedOut()) {
+// LogD (0, prep("Running"));
cAddEventListItem *e = NULL;
cSchedulesLock SchedulesLock(true, 10);
cSchedules *schedules = (cSchedules *)cSchedules::Schedules(SchedulesLock);
Lock();
while (schedules && (e = list->First()) != NULL) {
- tChannelID chID = e->GetChannelID();
+// tChannelID chID = e->GetChannelID();
cSchedule *schedule = (cSchedule *)schedules->GetSchedule(Channels.GetByChannelID(e->GetChannelID()), true);
- while (schedules && (e = list->First()) != NULL) {
+// while (schedules && (e = list->First()) != NULL) {
- if (chID == e->GetChannelID()) {
+// if (chID == e->GetChannelID()) {
+// LogD (0, prep("AddEvent"));
schedule->AddEvent(e->GetEvent());
+// LogD (0, prep("Del"));
list->Del(e);
- }
- }
+// }
+// }
+ LogD (0, prep("Sort"));
EpgHandlers.SortSchedule(schedule);
-// EpgHandlers.DropOutdated(schedule, e->GetEvent()->StartTime(), e->GetEvent()->EndTime(), e->GetEvent()->TableID(), e->GetEvent()->Version());
+ EpgHandlers.DropOutdated(schedule, e->GetEvent()->StartTime(), e->GetEvent()->EndTime(), e->GetEvent()->TableID(), e->GetEvent()->Version());
+// LogD (0, prep("Sorted"));
}
+// LogD (0, prep("Unlock"));
Unlock();
cCondWait::SleepMs(10);
}
@@ -203,6 +210,7 @@ void cAddEventThread::Action(void)
void cAddEventThread::AddEvent(cEvent *Event, tChannelID ChannelID)
{
LOCK_THREAD;
+// LogD (0, prep("AddEventT %s channel: <%s>"), Event->Title(), *ChannelID.ToString());
list->Add(new cAddEventListItem(Event, ChannelID));
LastHandleEvent.Set(INSERT_TIMEOUT_IN_MS);
}
@@ -213,6 +221,7 @@ static cAddEventThread AddEventThread;
void AddEvent(cEvent *Event, tChannelID ChannelID)
{
+ LogD (0, prep("AddEvent %s channel: <%s>"), Event->Title(), *ChannelID.ToString());
AddEventThread.AddEvent(Event, ChannelID);
if (!AddEventThread.Active())
AddEventThread.Start();
diff --git a/util.h b/util.h
index 69c0717..dec5b70 100644
--- a/util.h
+++ b/util.h
@@ -8,6 +8,8 @@
#ifndef UTIL_H_
#define UTIL_H_
#include <time.h>
+#include <stdlib.h>
+
class cChannel;
struct tChannelID;
class cEvent;