retune on lostlock is now working :)
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 19 Jan 2006 00:21:14 +0000 (00:21 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 19 Jan 2006 00:21:14 +0000 (00:21 +0000)
lib/dvb/dvb.cpp
lib/dvb/dvb.h
lib/dvb/frontend.cpp

index 5c8c2cf..32e1930 100644 (file)
@@ -591,8 +591,9 @@ void eDVBChannel::frontendStateChanged(iDVBFrontend*fe)
                ourstate = state_tuning;
        } else if (state == iDVBFrontend::stateLostLock)
        {
                ourstate = state_tuning;
        } else if (state == iDVBFrontend::stateLostLock)
        {
-               eDebug("OURSTATE: lost lock");
-               ourstate = state_unavailable;
+               eDebug("OURSTATE: lost lock.. retune");
+               ourstate = state_tuning;
+               m_frontend->get().tune(*m_feparm);
        } else if (state == iDVBFrontend::stateFailed)
        {
                eDebug("OURSTATE: failed");
        } else if (state == iDVBFrontend::stateFailed)
        {
                eDebug("OURSTATE: failed");
@@ -652,6 +653,7 @@ RESULT eDVBChannel::setChannel(const eDVBChannelID &channelid, ePtr<iDVBFrontend
                        /* if tuning fails, shutdown the channel immediately. */
        int res;
        res = m_frontend->get().tune(*feparm);
                        /* if tuning fails, shutdown the channel immediately. */
        int res;
        res = m_frontend->get().tune(*feparm);
+       m_feparm = feparm;
        
        if (res)
        {
        
        if (res)
        {
index 511ef9a..5fc2f04 100644 (file)
@@ -225,6 +225,7 @@ public:
 
        int getUseCount() { return m_use_count; }
 private:
 
        int getUseCount() { return m_use_count; }
 private:
+       ePtr<iDVBFrontendParameters> m_feparm; // for retune on lostlock
        ePtr<eDVBAllocatedFrontend> m_frontend;
        ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
        
        ePtr<eDVBAllocatedFrontend> m_frontend;
        ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
        
index a4a94a2..f4cbd30 100644 (file)
@@ -400,9 +400,7 @@ void eDVBFrontend::feEvent(int w)
                        else
                        {
                                state = stateLostLock;
                        else
                        {
                                state = stateLostLock;
-
-                               if (m_state != stateLostLock)
-                                       eDebug("FIXME: we lost lock, so we might have to retune.");
+                               m_data[0] = m_data[1] = m_data[2] = -1; // reset diseqc
                        }
                }
                if (m_state != state)
                        }
                }
                if (m_state != state)