add serviceinfo
[enigma2.git] / lib / dvb / pmt.cpp
index 68b1f6c..cc9ab4f 100644 (file)
@@ -44,6 +44,11 @@ void eDVBServicePMTHandler::channelStateChanged(iDVBChannel *channel)
                        if ( m_service && !m_service->cacheEmpty() )
                                serviceEvent(eventNewProgramInfo);
                }
+       } else if ((m_last_channel_state != iDVBChannel::state_failed) && 
+                       (state == iDVBChannel::state_failed))
+       {
+               eDebug("tune failed.");
+               serviceEvent(eventTuneFailed);
        }
 }
 
@@ -96,6 +101,7 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
        program.videoStreams.clear();
        program.audioStreams.clear();
        program.pcrPid = -1;
+       program.pmtPid = m_pmt_pid < 0x1fff ? m_pmt_pid : -1;
 
        if (!m_PMT.getCurrent(ptr))
        {
@@ -205,6 +211,7 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref)
                eDVBChannelID chid;
                ref.getChannelID(chid);
                res = m_resourceManager->allocateChannel(chid, m_channel);
+               eDebug("allocate Channel: res %d", res);
        } else
        {
                eDVBMetaParser parser;
@@ -229,6 +236,10 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref)
                        m_channelStateChanged_connection);
                m_last_channel_state = -1;
                channelStateChanged(m_channel);
+       } else
+       {
+               serviceEvent(eventTuneFailed);
+               return res;
        }
 
        if (m_pvr_channel)
@@ -268,7 +279,7 @@ void eDVBCAService::buildCAPMT()
 
                while( i != ptr->getSections().end() )
                {
-                       eDebug("append");
+//                     eDebug("append");
                        capmt.append(*i++);
                }
 
@@ -351,11 +362,11 @@ void eDVBCAService::sendCAPMT()
                        case 0xFFFFFFFF:
                                ++m_sendstate;
                                m_retryTimer.start(0,true);
-                               eDebug("[eDVBCAHandler] send failed .. immediate retry");
+//                             eDebug("[eDVBCAHandler] send failed .. immediate retry");
                                break;
                        default:
                                m_retryTimer.start(5000,true);
-                               eDebug("[eDVBCAHandler] send failed .. retry in 5 sec");
+//                             eDebug("[eDVBCAHandler] send failed .. retry in 5 sec");
                                break;
                }
                ++m_sendstate;