X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e677ac4a7bf81391877c909a703e5918ce4a511b..244459c4b2588ac9ca4b3fcbac05a2f8a7ee1641:/lib/dvb/pmt.cpp diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index 8c4388a4..d80897b9 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -2,6 +2,7 @@ #include #include #include +#include eDVBServicePMTHandler::eDVBServicePMTHandler() { @@ -27,8 +28,11 @@ void eDVBServicePMTHandler::channelStateChanged(iDVBChannel *channel) serviceEvent(eventTuned); if (m_demux) - { + { eDebug("ok ... now we start!!"); + + /* emit */ m_resourceManager->m_channelRunning(channel); + m_PAT.begin(eApp, eDVBPATSpec(), m_demux); } } @@ -44,6 +48,7 @@ void eDVBServicePMTHandler::PMTready(int error) void eDVBServicePMTHandler::PATready(int) { + eDebug("got PAT"); ePtr > ptr; if (!m_PAT.getCurrent(ptr)) { @@ -67,6 +72,7 @@ void eDVBServicePMTHandler::PATready(int) int eDVBServicePMTHandler::getProgramInfo(struct program &program) { + eDebug("got PMT"); ePtr > ptr; program.videoStreams.clear(); @@ -126,13 +132,33 @@ int eDVBServicePMTHandler::getDemux(ePtr &demux) int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref) { RESULT res; - m_channel = 0; - m_channelStateChanged_connection = 0; m_reference = ref; - eDVBChannelID chid; - ref.getChannelID(chid); - res = m_resourceManager->allocateChannel(chid, m_channel); - eDebug("eDVBServicePMTHandler: tune %d", res); + +// ref.path = "/viva.ts"; // hrhr. + + /* is this a normal (non PVR) channel? */ + if (ref.path.empty()) + { + eDVBChannelID chid; + ref.getChannelID(chid); + res = m_resourceManager->allocateChannel(chid, m_channel); + } else + { + eDVBMetaParser parser; + + if (parser.parseFile(ref.path)) + eWarning("no .meta file found, trying original service ref."); + else + m_reference = parser.m_ref; + + eDebug("alloc PVR"); + /* allocate PVR */ + res = m_resourceManager->allocatePVRChannel(m_pvr_channel); + if (res) + eDebug("allocatePVRChannel failed!\n"); + m_channel = m_pvr_channel; + } + if (m_channel) { m_channel->connectStateChange( @@ -141,5 +167,9 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref) m_last_channel_state = -1; channelStateChanged(m_channel); } + + if (m_pvr_channel) + m_pvr_channel->playFile(ref.path.c_str()); + return res; }