diff options
-rw-r--r-- | equivhandler.c | 48 | ||||
-rw-r--r-- | setupeepg.h | 6 | ||||
-rw-r--r-- | util.c | 1 | ||||
-rw-r--r-- | util.h | 1 |
4 files changed, 31 insertions, 25 deletions
diff --git a/equivhandler.c b/equivhandler.c index c2846f7..b10c004 100644 --- a/equivhandler.c +++ b/equivhandler.c @@ -114,9 +114,9 @@ void cEquivHandler::loadEquivalentChannelMap (void) } //while fclose (File); equiChanFileTime = st.st_mtim.tv_nsec; - LogD(3, prep("Loaded %i equivalents."), equiChanMap.size()); + LogD(2, prep("Loaded %i equivalents."), equiChanMap.size()); for ( it2=equiChanMap.begin() ; it2 != equiChanMap.end(); it2++ ) - LogD(3, prep("Original ID %s <-> Equivalent ID %s"), (*it2).first.c_str(), it2->second.c_str()); + LogD(2, prep("Original ID %s <-> Equivalent ID %s"), (*it2).first.c_str(), it2->second.c_str()); } //if file } @@ -124,24 +124,24 @@ void cEquivHandler::updateEquivalent(cSchedules * Schedules, tChannelID channelI multimap<string,string>::iterator it; pair<multimap<string,string>::iterator,multimap<string,string>::iterator> ret; - LogD(3, prep("Start updateEquivalent %s"), *channelID.ToString()); + LogD(2, prep("Start updateEquivalent %s"), *channelID.ToString()); ret = equiChanMap.equal_range(*channelID.ToString()); for (it=ret.first; it!=ret.second; ++it) { - LogD(1, prep("equivalent channel exists")); + LogD(2, prep("equivalent channel exists")); tChannelID equChannelID (tChannelID::FromString((*it).second.c_str())); cChannel *equChannel = GetChannelByID (equChannelID, false); if (equChannel) { - LogD(3, prep("found Equivalent channel %s"), *equChannelID.ToString()); + LogD(2, prep("found Equivalent channel %s"), *equChannelID.ToString()); cSchedule *pSchedule = (cSchedule *) Schedules->GetSchedule (equChannel, true); cEvent *pEqvEvent = (cEvent *) pSchedule->GetEvent (pEvent->EventID(), pEvent->StartTime()); if (pEqvEvent) { - LogD(1, prep("equivalent event exists")); + LogD(3, prep("equivalent event exists")); if (pEqvEvent == pEvent) { - LogD(1, prep("equal event exists")); + LogD(3, prep("equal event exists")); } else { - LogD(1, prep("remove equivalent")); + LogD(2, prep("remove equivalent")); pSchedule->DelEvent(pEqvEvent); cEvent* newEvent = new cEvent (pEvent->EventID()); newEvent->SetTableID (pEvent->TableID()); @@ -162,7 +162,7 @@ void cEquivHandler::updateEquivalent(cSchedules * Schedules, tChannelID channelI } } else { - LogD(1, prep("equivalent event does not exist")); + LogD(3, prep("equivalent event does not exist")); cEvent* newEvent = new cEvent (pEvent->EventID()); newEvent->SetTableID (pEvent->TableID()); newEvent->SetStartTime (pEvent->StartTime()); @@ -188,11 +188,11 @@ void cEquivHandler::updateEquivalent(tChannelID channelID, cEvent *pEvent){ multimap<string,string>::iterator it; pair<multimap<string,string>::iterator,multimap<string,string>::iterator> ret; - LogD(3, prep("Start updateEquivalent %s"), *channelID.ToString()); + LogD(2, prep("Start updateEquivalent %s"), *channelID.ToString()); ret = equiChanMap.equal_range(*channelID.ToString()); for (it=ret.first; it!=ret.second; ++it) { - LogD(1, prep("equivalent channel exists")); + LogD(2, prep("equivalent channel exists")); tChannelID equChannelID (tChannelID::FromString((*it).second.c_str())); cEvent* newEvent = new cEvent (pEvent->EventID()); newEvent->SetTableID (pEvent->TableID()); @@ -245,21 +245,21 @@ void cEquivHandler::sortEquivalents(tChannelID channelID, cSchedules* Schedules) multimap<string, string>::iterator it; pair < multimap < string, string > ::iterator, multimap < string, string > ::iterator > ret; - ret = cEquivHandler::getEquiChanMap().equal_range(*channelID.ToString()); + LogD(2, prep("sortEquivalents for channel %s count: %d"), *channelID.ToString(), cEquivHandler::getEquiChanMap().count(*channelID.ToString())); + + ret = equiChanMap.equal_range(*channelID.ToString()); for (it = ret.first; it != ret.second; ++it) + { + LogD(3, prep("equivalent channel exists")); + tChannelID equChannelID(tChannelID::FromString((*it).second.c_str())); + cChannel* pChannel = GetChannelByID(equChannelID, false); + if (pChannel) { - LogD(3, prep("equivalent channel exists")); - tChannelID equChannelID(tChannelID::FromString((*it).second.c_str())); - cChannel* pChannel = GetChannelByID(equChannelID, false); - if (pChannel) - { - LogD(3, prep("found Equivalent channel %s"), - *equChannelID.ToString()); - cSchedule* pSchedule = (cSchedule *) Schedules->GetSchedule(pChannel, - true); + LogD(2, prep("found Equivalent channel %s"), *equChannelID.ToString()); + cSchedule* pSchedule = (cSchedule *) Schedules->GetSchedule(pChannel, true); - pSchedule->Sort(); - Schedules->SetModified(pSchedule); - } + pSchedule->Sort(); + Schedules->SetModified(pSchedule); } + } } diff --git a/setupeepg.h b/setupeepg.h index ffd9eb8..4c30ede 100644 --- a/setupeepg.h +++ b/setupeepg.h @@ -7,6 +7,7 @@ #ifndef SETUPEEPG_H_ #define SETUPEEPG_H_ +#include <string.h> class cSetupEEPG { @@ -31,7 +32,10 @@ public: void setConfDir(char* confDir) { - ConfDir = confDir; + if (ConfDir) + delete ConfDir; + ConfDir = new char[strlen(confDir)+1]; + strcpy(ConfDir, confDir); } private: @@ -7,6 +7,7 @@ #include "util.h" #include <vdr/channels.h> #include <vdr/thread.h> +#include <vdr/epg.h> namespace util { @@ -10,6 +10,7 @@ #include <time.h> class cChannel; struct tChannelID; +class cEvent; namespace util { |