convert event_id from string to long
[enigma2.git] / lib / dvb / dvb.cpp
index 6a0211ec54f3701e38d56b85f2e42a7ac6d123e2..8af8bb0ed706d2a5b9007d1dddb4dc153546a016 100644 (file)
@@ -304,7 +304,7 @@ RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, eUse
                if(channelid==cache_chan->getChannelID())
                {
                        eDebug("use cached_channel");
-                       channel=m_cached_channel;
+                       channel = m_cached_channel;
                        return 0;
                }
                m_cached_channel=0;
@@ -591,8 +591,18 @@ void eDVBChannel::frontendStateChanged(iDVBFrontend*fe)
                ourstate = state_tuning;
        } else if (state == iDVBFrontend::stateLostLock)
        {
-               eDebug("OURSTATE: lost lock");
-               ourstate = state_unavailable;
+                       /* on managed channels, we try to retune in order to re-acquire lock. */
+               if (m_feparm)
+               {
+                       eDebug("OURSTATE: lost lock, trying to retune");
+                       ourstate = state_tuning;
+                       m_frontend->get().tune(*m_feparm);
+               } else
+                       /* on unmanaged channels, we don't do this. the client will do this. */
+               {
+                       eDebug("OURSTATE: lost lock, unavailable now.");
+                       ourstate = state_unavailable;
+               }
        } else if (state == iDVBFrontend::stateFailed)
        {
                eDebug("OURSTATE: failed");
@@ -652,6 +662,7 @@ RESULT eDVBChannel::setChannel(const eDVBChannelID &channelid, ePtr<iDVBFrontend
                        /* if tuning fails, shutdown the channel immediately. */
        int res;
        res = m_frontend->get().tune(*feparm);
+       m_feparm = feparm;
        
        if (res)
        {
@@ -749,6 +760,7 @@ RESULT eDVBChannel::playFile(const char *file)
        m_stateChanged(this);
        
        m_pvr_thread = new eFilePushThread();
+       m_pvr_thread->enablePVRCommit(1);
        m_pvr_thread->start(m_pvr_fd_src, m_pvr_fd_dst);
        CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);