X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9df197b0346cdea53967bf9ed578ff30e2424100..bf7eccb938f67b379494775d34d0312828e1c8bf:/lib/dvb/scan.cpp diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp index 01b3cd32..ade63d8f 100644 --- a/lib/dvb/scan.cpp +++ b/lib/dvb/scan.cpp @@ -22,7 +22,9 @@ DEFINE_REF(eDVBScan); -eDVBScan::eDVBScan(iDVBChannel *channel): m_channel(channel) +eDVBScan::eDVBScan(iDVBChannel *channel) + :m_channel(channel), m_ready(0), m_flags(0), m_ready_all(readySDT) + ,m_channel_state(iDVBChannel::state_idle) { if (m_channel->getDemux(m_demux)) SCAN_eDebug("scan: failed to allocate demux!"); @@ -98,10 +100,10 @@ RESULT eDVBScan::nextChannel() if (m_ch_toScan.empty()) { - eDebug("no channels left to scan."); - eDebug("%d channels scanned, %d were unavailable.", - m_ch_scanned.size(), m_ch_unavailable.size()); - eDebug("%d channels in database.", m_new_channels.size()); +// SCAN_eDebug("no channels left to scan."); +// SCAN_eDebug("%d channels scanned, %d were unavailable.", +// m_ch_scanned.size(), m_ch_unavailable.size()); +// SCAN_eDebug("%d channels in database.", m_new_channels.size()); m_event(evtFinish); return -ENOENT; } @@ -252,6 +254,11 @@ void eDVBScan::channelDone() if (m_ready & validSDT) { unsigned long hash = 0; + + // m_ch_current is not set, when eDVBScan is just used for a SDT update + if (!m_ch_current) + m_channel->getCurrentFrontendParameters(m_ch_current); + m_ch_current->getHash(hash); eDVBNamespace dvbnamespace = buildNamespace( @@ -339,7 +346,7 @@ void eDVBScan::channelDone() if ( m_chid_current.dvbnamespace.get() != -1 && ((ns.get() ^ m_chid_current.dvbnamespace.get()) & 0xFFFF0000)) - eDebug("dropping this transponder, it's on another satellite."); + SCAN_eDebug("dropping this transponder, it's on another satellite."); else { addChannelToScan( @@ -383,7 +390,7 @@ void eDVBScan::channelDone() These are the reasons for adding the transponder here, and not before. */ - + if (!m_chid_current) eWarning("SCAN: the current channel's ID was not corrected - not adding channel."); else @@ -421,7 +428,7 @@ void eDVBScan::start(const eSmartPtrList &known_transpon nextChannel(); } -void eDVBScan::insertInto(iDVBChannelList *db) +void eDVBScan::insertInto(iDVBChannelList *db, bool dontRemoveOldFlags) { if (m_flags & scanRemoveServices) { @@ -497,9 +504,10 @@ void eDVBScan::insertInto(iDVBChannelList *db) for (std::set::iterator x(scanned_sat_positions.begin()); x != scanned_sat_positions.end(); ++x) { eDVBChannelID chid; - if (m_flags & scanDontRemoveFeed) - chid.dvbnamespace = eDVBNamespace((*it)<<16)); - db->removeServices(chid, *it); + if (m_flags & scanDontRemoveFeeds) + chid.dvbnamespace = eDVBNamespace((*x)<<16); +// eDebug("remove %d %08x", *x, chid.dvbnamespace.get()); + db->removeServices(chid, *x); } } @@ -511,9 +519,24 @@ void eDVBScan::insertInto(iDVBChannelList *db) { ePtr dvb_service; if (!db->getService(service->first, dvb_service)) - *dvb_service = *service->second; + { + if (dvb_service->m_flags & eDVBService::dxNoSDT) + continue; + if (!(dvb_service->m_flags & eDVBService::dxHoldName)) + { + dvb_service->m_service_name = service->second->m_service_name; + dvb_service->m_service_name_sort = service->second->m_service_name_sort; + } + dvb_service->m_provider_name = service->second->m_provider_name; + + if (!dontRemoveOldFlags) // do not remove new found flags when not wished + dvb_service->m_flags &= ~eDVBService::dxNewFound; + } else + { db->addService(service->first, service->second); + service->second->m_flags |= eDVBService::dxNewFound; + } } }