add remove multiple whitespaces to descriptors,-fix scanSDT

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


Origin commit data
------------------
Branch: ni/coolstream
Commit: 39145b7a32
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2010-10-08 (Fri, 08 Oct 2010)

Origin message was:
------------------
-add remove multiple whitespaces to descriptors,-fix scanSDT

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


------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2010-10-08 14:58:42 +00:00
parent dc7fed2195
commit 949e391dc0
2 changed files with 16 additions and 3 deletions

View File

@@ -399,6 +399,19 @@ bool check_blacklisted_digital_plus(const t_original_network_id onid, const t_tr
else
return false;
}
void removeMultipleWhitespaces (std::string &str)
{
size_t pos = str.find(" ");
if(pos != std::string::npos ){
std::string temp;
for ( unsigned short i = 0 ; i < str.length(); i++)
if (!(str[i] == ' ' && str[i+1] == ' '))
temp += str[i];
str = temp;
}
}
bool check_blacklisted(std::string& providerName)
{
bool in_blacklist = false;
@@ -600,7 +613,8 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s
providerName=lastProviderName;
}
}
removeMultipleWhitespaces( providerName );
// remove space at ende providerName
if(!providerName.empty()){
i = 1;
@@ -615,7 +629,6 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s
const char *unknown_provider_name = "Unknown Provider";
providerName = CDVBString(unknown_provider_name, strlen(unknown_provider_name)).getContent();
}
lastProviderName = providerName;
eventServer->sendEvent(CZapitClient::EVT_SCAN_PROVIDER, CEventServer::INITID_ZAPIT, (void *) lastProviderName.c_str(), lastProviderName.length() + 1);

View File

@@ -2217,7 +2217,6 @@ int zapit_main_thread(void *data)
eventServer = new CEventServer;
pthread_create (&tsdt, NULL, sdt_thread, (void *) NULL);
tallchans_iterator cit;
cit = allchans.find(live_channel_id);
if(cit != allchans.end())
@@ -2229,6 +2228,7 @@ int zapit_main_thread(void *data)
firstzap = false;
stime = time(0);
//time_t curtime;
pthread_create (&tsdt, NULL, sdt_thread, (void *) NULL);
while (zapit_server.run(zapit_parse_command, CZapitMessages::ACTVERSION, true)) {
if (pmt_update_fd != -1) {
unsigned char buf[4096];