X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/8c96830db4f49095820d7abc071d511561bf1561..b8f5ce238d6307c1030956c470e550b711493f3c:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 6e2d9610..a6f4eec7 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -185,6 +186,8 @@ int eStaticServiceDVBPVRInformation::getInfo(const eServiceReference &ref, int w { case iServiceInformation::sDescription: return iServiceInformation::resIsString; + case iServiceInformation::sServiceref: + return iServiceInformation::resIsString; case iServiceInformation::sTimeCreate: if (m_parser.m_time_create) return m_parser.m_time_create; @@ -201,6 +204,8 @@ std::string eStaticServiceDVBPVRInformation::getInfoString(const eServiceReferen { case iServiceInformation::sDescription: return m_parser.m_description; + case iServiceInformation::sServiceref: + return m_parser.m_ref.toString(); default: return ""; } @@ -233,11 +238,18 @@ RESULT eDVBPVRServiceOfflineOperations::deleteFromDisk(int simulate) if (getListOfFilenames(res)) return -1; + eBackgroundFileEraser *eraser = eBackgroundFileEraser::getInstance(); + if (!eraser) + eDebug("FATAL !! can't get background file eraser"); + /* TODO: deferred removing.. */ for (std::list::iterator i(res.begin()); i != res.end(); ++i) { eDebug("Removing %s...", i->c_str()); - ::unlink(i->c_str()); + if (eraser) + eraser->erase(i->c_str()); + else + ::unlink(i->c_str()); } return 0; @@ -248,6 +260,19 @@ RESULT eDVBPVRServiceOfflineOperations::getListOfFilenames(std::list &service, const eServ eDVBServicePlay::eDVBServicePlay(const eServiceReference &ref, eDVBService *service): m_reference(ref), m_dvb_service(service), m_is_paused(0) { - m_is_pvr = !ref.path.empty(); + m_is_primary = 1; + m_is_pvr = !m_reference.path.empty(); m_timeshift_enabled = m_timeshift_active = 0; m_skipmode = 0; @@ -650,7 +676,8 @@ RESULT eDVBServicePlay::start() /* in pvr mode, we only want to use one demux. in tv mode, we're using two (one for decoding, one for data source), as we must be prepared to start recording from the data demux. */ - m_cue = new eCueSheet(); + if (m_is_pvr) + m_cue = new eCueSheet(); m_first_program_info = 1; eServiceReferenceDVB &service = (eServiceReferenceDVB&)m_reference; @@ -702,6 +729,12 @@ RESULT eDVBServicePlay::stop() return 0; } +RESULT eDVBServicePlay::setTarget(int target) +{ + m_is_primary = !target; + return 0; +} + RESULT eDVBServicePlay::connectEvent(const Slot2 &event, ePtr &connection) { connection = new eConnection((iPlayableService*)this, m_event.connect(event)); @@ -1414,6 +1447,7 @@ void eDVBServicePlay::switchToLive() if (!m_timeshift_active) return; + m_cue = 0; m_decoder = 0; m_decode_demux = 0; /* free the timeshift service handler, we need the resources */ @@ -1440,6 +1474,7 @@ void eDVBServicePlay::switchToTimeshift() eServiceReferenceDVB r = (eServiceReferenceDVB&)m_reference; r.path = m_timeshift_file; + m_cue = new eCueSheet(); m_service_handler_timeshift.tune(r, 1, m_cue); /* use the decoder demux for everything */ updateDecoder(); /* mainly to switch off PCR */ } @@ -1499,7 +1534,7 @@ void eDVBServicePlay::updateDecoder() { h.getDecodeDemux(m_decode_demux); if (m_decode_demux) - m_decode_demux->getMPEGDecoder(m_decoder); + m_decode_demux->getMPEGDecoder(m_decoder, m_is_primary); if (m_cue) m_cue->setDecodingDemux(m_decode_demux, m_decoder); } @@ -1509,11 +1544,13 @@ void eDVBServicePlay::updateDecoder() m_decoder->setVideoPID(vpid); m_current_audio_stream = 0; m_decoder->setAudioPID(apid, apidtype); - if (!(m_is_pvr || m_timeshift_active)) + if (!(m_is_pvr || m_timeshift_active || !m_is_primary)) m_decoder->setSyncPCR(pcrpid); else m_decoder->setSyncPCR(-1); m_decoder->setTextPID(tpid); + if (!m_is_primary) + m_decoder->setTrickmode(1); m_decoder->start(); // how we can do this better? // update cache pid when the user changed the audio track or video track