X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/056f4ed60ae323f41601b8acdc42794902eac0d1..d43e4676bd757d1de73b8dd669154ffd42192b10:/lib/dvb/scan.cpp diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp index 17c6b5c2..89c4735a 100644 --- a/lib/dvb/scan.cpp +++ b/lib/dvb/scan.cpp @@ -15,19 +15,18 @@ #include #include #include -#include -#define SCAN_eDebug(x...) eDebug(x) -#define SCAN_eDebugNoNewLine(x...) eDebugNoNewLine(x) +static bool scan_debug; +#define SCAN_eDebug(x...) do { if (scan_debug) eDebug(x); } while(0) +#define SCAN_eDebugNoNewLine(x...) do { if (scan_debug) eDebugNoNewLine(x); } while(0) DEFINE_REF(eDVBScan); -eDVBScan::eDVBScan(iDVBChannel *channel): m_channel(channel) +eDVBScan::eDVBScan(iDVBChannel *channel, bool debug) + :m_channel(channel), m_channel_state(iDVBChannel::state_idle) + ,m_ready(0), m_ready_all(readySDT), m_flags(0) { - m_ready = m_flags = 0; - m_ready_all = readySDT; - m_channel_state = iDVBChannel::state_idle; - + scan_debug=debug; if (m_channel->getDemux(m_demux)) SCAN_eDebug("scan: failed to allocate demux!"); m_channel->connectStateChange(slot(*this, &eDVBScan::stateChange), m_stateChanged_connection); @@ -257,13 +256,12 @@ void eDVBScan::channelDone() { unsigned long hash = 0; - ePtr p = m_ch_current; - - if (!p) // used in sdt scan - m_channel->getCurrentFrontendParameters(p); - - p->getHash(hash); + // 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( (**m_SDT->getSections().begin()).getOriginalNetworkId(), (**m_SDT->getSections().begin()).getTransportStreamId(), @@ -394,16 +392,12 @@ void eDVBScan::channelDone() here, and not before. */ - ePtr p = m_ch_current; - if (!p) - m_channel->getCurrentFrontendParameters(p); - if (!m_chid_current) eWarning("SCAN: the current channel's ID was not corrected - not adding channel."); else - addKnownGoodChannel(m_chid_current, p); - - m_ch_scanned.push_back(p); + addKnownGoodChannel(m_chid_current, m_ch_current); + + m_ch_scanned.push_back(m_ch_current); nextChannel(); } @@ -535,7 +529,8 @@ void eDVBScan::insertInto(iDVBChannelList *db, bool dontRemoveOldFlags) dvb_service->m_service_name_sort = service->second->m_service_name_sort; } dvb_service->m_provider_name = service->second->m_provider_name; - + if (service->second->m_ca.size()) + dvb_service->m_ca = service->second->m_ca; if (!dontRemoveOldFlags) // do not remove new found flags when not wished dvb_service->m_flags &= ~eDVBService::dxNewFound; } @@ -595,7 +590,7 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription for (CaSystemIdList::const_iterator i(caids.begin()); i != caids.end(); ++i) { SCAN_eDebugNoNewLine("%04x ", *i); - service->m_ca.insert(*i); + service->m_ca.push_front(*i); } SCAN_eDebug(""); break;