aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-05-09 21:22:22 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-05-09 21:22:22 +0000
commitbf7eccb938f67b379494775d34d0312828e1c8bf (patch)
treef8ac79e42b88b4ec3bb78c4239ff73743e90fc79 /lib
parent056f4ed60ae323f41601b8acdc42794902eac0d1 (diff)
downloadenigma2-bf7eccb938f67b379494775d34d0312828e1c8bf.tar.gz
enigma2-bf7eccb938f67b379494775d34d0312828e1c8bf.zip
revert unneeded changes for sdt update
restructure code for better readability add some comments remove some debug output
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb/pmt.cpp17
-rw-r--r--lib/dvb/scan.cpp37
2 files changed, 18 insertions, 36 deletions
diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp
index 74042ed0..4af18020 100644
--- a/lib/dvb/pmt.cpp
+++ b/lib/dvb/pmt.cpp
@@ -443,32 +443,21 @@ int eDVBServicePMTHandler::getPVRChannel(ePtr<iDVBPVRChannel> &pvr_channel)
void eDVBServicePMTHandler::SDTScanEvent(int event)
{
- eDebug("scan event %d!", event);
-
switch (event)
{
case eDVBScan::evtFinish:
{
ePtr<iDVBChannelList> db;
- int err;
- if ((err = m_resourceManager->getChannelList(db)) != 0)
+ if (m_resourceManager->getChannelList(db) != 0)
eDebug("no channel list");
else
{
m_dvb_scan->insertInto(db);
- eDebug("scan done!");
+ eDebug("sdt update done!");
}
break;
}
- case eDVBScan::evtNewService:
- eDebug("scan new service");
- break;
-
- case eDVBScan::evtFail:
- eDebug("scan failed.");
- break;
-
default:
break;
}
@@ -558,7 +547,7 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
void eDVBServicePMTHandler::free()
{
- eDVBScan *tmp = m_dvb_scan;
+ eDVBScan *tmp = m_dvb_scan; // do a copy on stack (recursive call of free()) !!!
m_dvb_scan = 0;
delete m_dvb_scan;
diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp
index 17c6b5c2..ade63d8f 100644
--- a/lib/dvb/scan.cpp
+++ b/lib/dvb/scan.cpp
@@ -22,12 +22,10 @@
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)
{
- m_ready = 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!");
m_channel->connectStateChange(slot(*this, &eDVBScan::stateChange), m_stateChanged_connection);
@@ -102,10 +100,10 @@ RESULT eDVBScan::nextChannel()
if (m_ch_toScan.empty())
{
- 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());
+// 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;
}
@@ -257,13 +255,12 @@ void eDVBScan::channelDone()
{
unsigned long hash = 0;
- ePtr<iDVBFrontendParameters> 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 +391,12 @@ void eDVBScan::channelDone()
here, and not before.
*/
- ePtr<iDVBFrontendParameters> 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();
}