From 9a632d21c0c849f2e08d388df916e055fbaf42ca Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 29 Apr 2008 12:24:22 +0000 Subject: [PATCH] add workaround also for duplicate(non dvb compliant) tsid/nid combinations in cable / terrestrial networks --- lib/dvb/db.cpp | 24 ++++++++++++++++++------ lib/dvb/frontend.cpp | 2 ++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index 03c51212..e4a97713 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -1160,10 +1160,15 @@ RESULT eDVBDB::removeServices(eDVBChannelID chid, unsigned int orbpos) if ((unsigned int)sat.orbital_position != orbpos) remove=false; } - else if (orbpos != 0xFFFFFFFF) // do not remove -C or -T transponders when a orbital position is given.. - remove=false; - if ( remove && chid.dvbnamespace != eNs && chid.dvbnamespace != ch.dvbnamespace ) - remove=false; + if ( remove && chid.dvbnamespace != eNs ) + { + if (system == iDVBFrontend::feCable && chid.dvbnamespace.get() == 0xFFFF0000) + ; + else if (system == iDVBFrontend::feTerrestrial && chid.dvbnamespace.get() == 0xEEEE0000) + ; + else if ( chid.dvbnamespace != ch.dvbnamespace ) + remove=false; + } if ( remove && chid.original_network_id != eOnid && chid.original_network_id != ch.original_network_id ) remove=false; if ( remove && chid.transport_stream_id != eTsid && chid.transport_stream_id != ch.transport_stream_id ) @@ -1249,8 +1254,15 @@ RESULT eDVBDB::removeFlags(unsigned int flagmask, eDVBChannelID chid, unsigned i if ((unsigned int)sat.orbital_position != orbpos) remove=false; } - if ( remove && chid.dvbnamespace != eNs && chid.dvbnamespace != ch.dvbnamespace ) - remove=false; + if ( remove && chid.dvbnamespace != eNs ) + { + if (system == iDVBFrontend::feCable && chid.dvbnamespace.get() == 0xFFFF0000) + ; + else if (system == iDVBFrontend::feTerrestrial && chid.dvbnamespace.get() == 0xEEEE0000) + ; + else if ( chid.dvbnamespace != ch.dvbnamespace ) + remove=false; + } if ( remove && chid.original_network_id != eOnid && chid.original_network_id != ch.original_network_id ) remove=false; if ( remove && chid.transport_stream_id != eTsid && chid.transport_stream_id != ch.transport_stream_id ) diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index c7a475d2..8754e773 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -371,9 +371,11 @@ RESULT eDVBFrontendParameters::getHash(unsigned long &hash) const } case iDVBFrontend::feCable: hash = 0xFFFF0000; + hash |= (cable.frequency/1000)&0xFFFF; return 0; case iDVBFrontend::feTerrestrial: hash = 0xEEEE0000; + hash |= (terrestrial.frequency/1000)&0xFFFF; return 0; default: return -1; -- 2.30.2