shutdown channel if tune fails
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 15 Nov 2005 23:06:24 +0000 (23:06 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 15 Nov 2005 23:06:24 +0000 (23:06 +0000)
lib/dvb/dvb.cpp

index 0201b337fb7ee32837931a671d733b5dd1f3040f..32c7ea31a67d1b06e9ca9e68a996e71cd188e28e 100644 (file)
@@ -491,7 +491,18 @@ RESULT eDVBChannel::setChannel(const eDVBChannelID &channelid)
        m_channel_id = channelid;
        m_mgr->addChannel(channelid, this);
        m_state = state_tuning;
-       return m_frontend->get().tune(*feparm);
+                       /* if tuning fails, shutdown the channel immediately. */
+       int res;
+       res = m_frontend->get().tune(*feparm);
+       
+       if (res)
+       {
+               m_state = state_release;
+               m_stateChanged(this);
+               return res;
+       }
+       
+       return 0;
 }
 
 RESULT eDVBChannel::connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection)