diff options
author | Jochen Dolze <vdr@dolze.de> | 2009-03-05 22:01:56 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2009-03-05 22:01:56 +0100 |
commit | 2417d1f3902ee7bfa78ffd6aeb3ea5421a7ac2dd (patch) | |
tree | 4ab43f05a7adbe33c811f761366300c079b48273 /infosatepg.cpp | |
parent | 7a79077d12b0cae3db32cffa35101e95ed86c8cc (diff) | |
download | vdr-plugin-infosatepg-2417d1f3902ee7bfa78ffd6aeb3ea5421a7ac2dd.tar.gz vdr-plugin-infosatepg-2417d1f3902ee7bfa78ffd6aeb3ea5421a7ac2dd.tar.bz2 |
Moved processing into a thread
Small wakeup handling fixes
Diffstat (limited to 'infosatepg.cpp')
-rw-r--r-- | infosatepg.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/infosatepg.cpp b/infosatepg.cpp index e8b1ca0..74f029b 100644 --- a/infosatepg.cpp +++ b/infosatepg.cpp @@ -127,14 +127,18 @@ void cPluginInfosatepg::MainThreadHook(void) // Perform actions in the context of the main program thread. if (!global->WaitOk()) return; - if (!global->ProcessedAll()) + if ((global->Infosatdata[pmac].ReceivedAll()) && (!global->ProcessedAll())) { - if ((!global->Infosatdata[pmac].Processed) && global->Infosatdata[pmac].ReceivedAll()) + if (!global->Infosatdata[pmac].Processed) { isyslog ("infosatepg: found data to be processed: day=%i month=%i", global->Infosatdata[pmac].Day(),global->Infosatdata[pmac].Month()); cProcessInfosatepg process(pmac,global); - if (global->Infosatdata[pmac].Processed) pmac++; + process.Start(); + } + else + { + pmac++; } global->SetWaitTimer(); } @@ -233,18 +237,11 @@ time_t cPluginInfosatepg::WakeupTime(void) if (global->WakeupTime()==-1) return 0; // just to be safe time_t Now = time(NULL); time_t Time = global->WakeupTime(); - double diff = difftime(Time,Now); - if (diff<0) + if (difftime(Time,Now)<0) { // wakeup time is in the past -> add a day Time = cTimer::IncDay(Time,1); } - else - { - // wakeup time is in less than 1 hour -> add a day - if (diff<3600) - Time = cTimer::IncDay(Time,1); - } return Time; } |