diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 60cd0189d..dbb0231d1 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -82,7 +82,7 @@ struct transponder }; typedef std::map transponder_list_t; typedef std::map ::iterator stiterator; -typedef std::map sdt_tp_t; +typedef std::map sdt_tp_t; extern transponder_list_t scantransponders; extern transponder_list_t transponders; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 28062d8ae..9989da3b9 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -70,6 +70,7 @@ #include #endif +#include #include "libdvbsub/dvbsub.h" #include "libtuxtxt/teletext.h" @@ -534,11 +535,16 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", g_curre printf("[zapit] neither audio nor video pid found\n"); failed = true; } + + /* start sdt scan even if the service was not found in pat or pmt + * if the frontend did not tune, we don't get here, so this is fine */ + if (transponder_change) + sdt_wakeup = true; + if (failed) return -1; if (transponder_change == true) { - sdt_wakeup = 1; g_current_channel->getCaPmt()->ca_pmt_list_management = 0x03; } else { g_current_channel->getCaPmt()->ca_pmt_list_management = 0x04; @@ -2497,8 +2503,8 @@ printf("[sdt monitor] wakeup...\n"); } stI = sdt_tp.find(tpid); - if((stI != sdt_tp.end()) && stI->second) { - printf("[sdt monitor] TP already updated.\n"); + if ((stI != sdt_tp.end()) && ((time_monotonic() - stI->second) < 3600)) { + printf("[sdt monitor] TP already updated less than an hour ago.\n"); continue; } if(!curchans.empty()) @@ -2510,7 +2516,7 @@ printf("[sdt monitor] wakeup...\n"); printf("[sdt monitor] scanSDT broken ?\n"); continue; } - sdt_tp.insert(std::pair (tpid, true) ); + sdt_tp.insert(std::pair (tpid, time_monotonic())); char buffer[256]; fd = fopen(CURRENTSERVICES_TMP, "w");