summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-10-21 17:08:07 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2012-10-21 17:08:07 (GMT)
commita09e46d0dbeb29954f6ae72b95e00063455de0a2 (patch)
treebcbbc186a8eb319e15b366b75a30e0dc128e3326
parent28d4e67c2a4bcb355f8e525890a9acf515a70f70 (diff)
downloadvdr-plugin-eepg-a09e46d0dbeb29954f6ae72b95e00063455de0a2.tar.gz
vdr-plugin-eepg-a09e46d0dbeb29954f6ae72b95e00063455de0a2.tar.bz2
fix compile with some compiler
null check revert some changes
-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 12a7a95..ca6c759 100644
--- a/eit2.c
+++ b/eit2.c
@@ -632,7 +632,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;