diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 51d4809c9..e94ef3a8d 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -92,6 +92,7 @@ static int scanning = 1; extern bool epg_filter_is_whitelist; extern bool epg_filter_except_current_next; +static bool xml_epg_filter; static bool messaging_zap_detected = false; /*static*/ bool dvb_time_update = false; @@ -2153,7 +2154,7 @@ bool CEitManager::Start() config.epg_cache, config.epg_extendedcache, config.epg_max_events, config.epg_old_events); printf("[sectionsd] NTP: %s, server %s, command %s\n", ntpenable ? "enabled" : "disabled", ntpserver.c_str(), ntp_system_cmd_prefix.c_str()); - readEPGFilter(); + xml_epg_filter = readEPGFilter(); if (!sectionsd_server.prepare(SECTIONSD_UDS_NAME)) { fprintf(stderr, "[sectionsd] failed to prepare basic server\n"); @@ -2904,6 +2905,8 @@ unsigned CEitManager::getEventsCount() void CEitManager::addChannelFilter(t_original_network_id onid, t_transport_stream_id tsid, t_service_id sid) { OpenThreads::ScopedLock slock(filter_mutex); + if (xml_epg_filter) + return; epg_filter_except_current_next = true; epg_filter_is_whitelist = true; addEPGFilter(onid, tsid, sid); @@ -2912,6 +2915,8 @@ void CEitManager::addChannelFilter(t_original_network_id onid, t_transport_strea void CEitManager::clearChannelFilters() { OpenThreads::ScopedLock slock(filter_mutex); + if (xml_epg_filter) + return; clearEPGFilter(); epg_filter_is_whitelist = false; } diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 5087cc0d8..056235116 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -190,7 +190,7 @@ static void addNoDVBTimelist(t_original_network_id onid, t_transport_stream_id t } } -void readEPGFilter(void) +bool readEPGFilter(void) { xmlDocPtr filter_parser = parseXmlFile(epg_filter_dir.c_str()); @@ -223,6 +223,7 @@ void readEPGFilter(void) } } xmlFreeDoc(filter_parser); + return (CurrentEPGFilter != NULL); } void readDVBTimeFilter(void) diff --git a/src/eitd/xmlutil.h b/src/eitd/xmlutil.h index 91380c996..298bb54c4 100644 --- a/src/eitd/xmlutil.h +++ b/src/eitd/xmlutil.h @@ -37,7 +37,7 @@ void *insertEventsfromFile(void * data); void writeEventsToFile(char *epgdir); -void readEPGFilter(void); +bool readEPGFilter(void); void readDVBTimeFilter(void); bool checkEPGFilter(t_original_network_id onid, t_transport_stream_id tsid, t_service_id sid); bool checkBlacklist(t_channel_id channel_id);