- work around scan problem
[enigma2.git] / lib / dvb / scan.cpp
index 322f35c3ce01abcc34705fdd6c1c10628f0b0e7c..4b31aadaed0ecdf2b8c308a5b3edb3f1d2597ae9 100644 (file)
@@ -13,8 +13,8 @@
 #include <lib/base/eerror.h>
 #include <errno.h>
 
-#define SCAN_eDebug(x...)
-#define SCAN_eDebugNoNewLine(x...)
+#define SCAN_eDebug(x...) eDebug(x)
+#define SCAN_eDebugNoNewLine(x...) eDebugNoNewLine(x)
 
 DEFINE_REF(eDVBScan);
 
@@ -96,11 +96,18 @@ RESULT eDVBScan::nextChannel()
        m_ch_toScan.pop_front();
        
        if (m_channel->getFrontend(fe))
+       {
+               m_event(evtFail);
                return -ENOTSUP;
+       }
        
        m_channel_state = iDVBChannel::state_idle;
        if (fe->tune(*m_ch_current))
+       {
+               return nextChannel();
+               m_event(evtFail);
                return -EINVAL;
+       }
                
        m_event(evtUpdate);
        return 0;
@@ -298,7 +305,7 @@ void eDVBScan::start(const std::list<ePtr<iDVBFrontendParameters> > &known_trans
        nextChannel();
 }
 
-void eDVBScan::insertInto(eDVBDB *db)
+void eDVBScan::insertInto(iDVBChannelList *db)
 {
        for (std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> >::const_iterator 
                        ch(m_new_channels.begin()); ch != m_new_channels.end(); ++ch)
@@ -377,3 +384,10 @@ RESULT eDVBScan::connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &c
        connection = new eConnection(this, m_event.connect(event));
        return 0;
 }
+
+void eDVBScan::getStats(int &transponders_done, int &transponders_total, int &services)
+{
+       transponders_done = m_ch_scanned.size() + m_ch_unavailable.size();
+       transponders_total = m_ch_toScan.size() + transponders_done;
+       services = m_new_services.size();
+}