zapit: improve automatic SDT scan

- also start scan if current channel is not (no longer) in PAT/PMT
- do not scan transponder only once per neutrino start but once per
 hour

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1448 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: 5472ec8dd3
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-05-08 (Sun, 08 May 2011)

Origin message was:
------------------
zapit: improve automatic SDT scan

- also start scan if current channel is not (no longer) in PAT/PMT
- do not scan transponder only once per neutrino start but once per
 hour

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1448 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
Stefan Seyfried
2011-05-08 11:30:07 +00:00
parent 56747f817a
commit ef08f10322
2 changed files with 11 additions and 5 deletions

View File

@@ -82,7 +82,7 @@ struct transponder
}; };
typedef std::map <transponder_id_t, transponder> transponder_list_t; typedef std::map <transponder_id_t, transponder> transponder_list_t;
typedef std::map <transponder_id_t, transponder>::iterator stiterator; typedef std::map <transponder_id_t, transponder>::iterator stiterator;
typedef std::map<transponder_id_t, bool> sdt_tp_t; typedef std::map<transponder_id_t, time_t> sdt_tp_t;
extern transponder_list_t scantransponders; extern transponder_list_t scantransponders;
extern transponder_list_t transponders; extern transponder_list_t transponders;

View File

@@ -70,6 +70,7 @@
#include <audio_td.h> #include <audio_td.h>
#endif #endif
#include <driver/abstime.h>
#include "libdvbsub/dvbsub.h" #include "libdvbsub/dvbsub.h"
#include "libtuxtxt/teletext.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"); printf("[zapit] neither audio nor video pid found\n");
failed = true; 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) if (failed)
return -1; return -1;
if (transponder_change == true) { if (transponder_change == true) {
sdt_wakeup = 1;
g_current_channel->getCaPmt()->ca_pmt_list_management = 0x03; g_current_channel->getCaPmt()->ca_pmt_list_management = 0x03;
} else { } else {
g_current_channel->getCaPmt()->ca_pmt_list_management = 0x04; g_current_channel->getCaPmt()->ca_pmt_list_management = 0x04;
@@ -2497,8 +2503,8 @@ printf("[sdt monitor] wakeup...\n");
} }
stI = sdt_tp.find(tpid); stI = sdt_tp.find(tpid);
if((stI != sdt_tp.end()) && stI->second) { if ((stI != sdt_tp.end()) && ((time_monotonic() - stI->second) < 3600)) {
printf("[sdt monitor] TP already updated.\n"); printf("[sdt monitor] TP already updated less than an hour ago.\n");
continue; continue;
} }
if(!curchans.empty()) if(!curchans.empty())
@@ -2510,7 +2516,7 @@ printf("[sdt monitor] wakeup...\n");
printf("[sdt monitor] scanSDT broken ?\n"); printf("[sdt monitor] scanSDT broken ?\n");
continue; continue;
} }
sdt_tp.insert(std::pair <transponder_id_t, bool> (tpid, true) ); sdt_tp.insert(std::pair <transponder_id_t, time_t> (tpid, time_monotonic()));
char buffer[256]; char buffer[256];
fd = fopen(CURRENTSERVICES_TMP, "w"); fd = fopen(CURRENTSERVICES_TMP, "w");