X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/740ae9b4a03c13901e4f4ffc008e4c0cfd63d896..17b07b8ab4f698dfbef69fcf77b8f8d86c440f39:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index fc35b521..15deff62 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -613,12 +614,22 @@ void eDVBServicePlay::serviceEvent(int event) /* don't worry about non-existing services, nor pvr services */ if (m_dvb_service && !m_is_pvr) { + if (apidtype == eDVBAudio::aMPEG) + { + m_dvb_service->setCachePID(eDVBService::cAPID, apid); + m_dvb_service->setCachePID(eDVBService::cAC3PID, -1); + } + else + { + m_dvb_service->setCachePID(eDVBService::cAPID, -1); + m_dvb_service->setCachePID(eDVBService::cAC3PID, apid); + } m_dvb_service->setCachePID(eDVBService::cVPID, vpid); - m_dvb_service->setCachePID(eDVBService::cAPID, apid); m_dvb_service->setCachePID(eDVBService::cPCRPID, pcrpid); } } - + + m_event((iPlayableService*)this, evUpdatedInfo); break; } } @@ -721,7 +732,19 @@ RESULT eDVBServicePlay::unpause() RESULT eDVBServicePlay::seekTo(pts_t to) { - return -1; + eDebug("eDVBServicePlay::seekTo: jump %lld", to); + + ePtr pvr_channel; + + if (m_service_handler.getPVRChannel(pvr_channel)) + return -1; + + ePtr demux; + m_service_handler.getDemux(demux); + if (!demux) + return -1; + + return pvr_channel->seekTo(demux, 0, to); } RESULT eDVBServicePlay::seekRelative(int direction, pts_t to) @@ -755,10 +778,10 @@ RESULT eDVBServicePlay::getPlayPosition(pts_t &pos) if (!demux) return -1; - return pvr_channel->getCurrentPosition(demux, pos); + return pvr_channel->getCurrentPosition(demux, pos, 1); } -RESULT eDVBServicePlay::setTrickmode(int trick=0) +RESULT eDVBServicePlay::setTrickmode(int trick) { if (m_decoder) m_decoder->setTrickmode(trick); @@ -829,12 +852,51 @@ int eDVBServicePlay::getInfo(int w) switch (w) { + case sAspect: + if (!program.videoStreams.empty() && program.videoStreams[0].component_tag != -1) + { + ePtr evt; + if (!m_event_handler.getEvent(evt, 0)) + { + ePtr data; + if (!evt->getComponentData(data, program.videoStreams[0].component_tag)) + { + if ( data->getStreamContent() == 1 ) + { + switch(data->getComponentType()) + { + // SD + case 1: // 4:3 SD PAL + case 2: + case 3: // 16:9 SD PAL + case 4: // > 16:9 PAL + case 5: // 4:3 SD NTSC + case 6: + case 7: // 16:9 SD NTSC + case 8: // > 16:9 NTSC + + // HD + case 9: // 4:3 HD PAL + case 0xA: + case 0xB: // 16:9 HD PAL + case 0xC: // > 16:9 HD PAL + case 0xD: // 4:3 HD NTSC + case 0xE: + case 0xF: // 16:9 HD NTSC + case 0x10: // > 16:9 HD PAL + return data->getComponentType(); + } + } + } + } + } + return -1; + case sIsCrypted: return program.isCrypted; case sVideoPID: if (program.videoStreams.empty()) return -1; return program.videoStreams[0].pid; case sAudioPID: if (program.audioStreams.empty()) return -1; return program.audioStreams[m_current_audio_stream].pid; case sPCRPID: return program.pcrPid; case sPMTPID: return program.pmtPid; case sTXTPID: return -1; - case sSID: return ((const eServiceReferenceDVB&)m_reference).getServiceID().get(); case sONID: return ((const eServiceReferenceDVB&)m_reference).getOriginalNetworkID().get(); case sTSID: return ((const eServiceReferenceDVB&)m_reference).getTransportStreamID().get(); @@ -927,6 +989,23 @@ int eDVBServicePlay::selectAudioStream(int i) if (m_decoder->setAudioPID(program.audioStreams[i].pid, program.audioStreams[i].type)) return -4; + if (m_dvb_service && !m_is_pvr) + { + if (m_dvb_service && !m_is_pvr) + { + if (program.audioStreams[i].type == eDVBAudio::aMPEG) + { + m_dvb_service->setCachePID(eDVBService::cAPID, program.audioStreams[i].pid); + m_dvb_service->setCachePID(eDVBService::cAC3PID, -1); + } + else + { + m_dvb_service->setCachePID(eDVBService::cAPID, -1); + m_dvb_service->setCachePID(eDVBService::cAC3PID, program.audioStreams[i].pid); + } + } + } + m_current_audio_stream = i; return 0; @@ -958,29 +1037,8 @@ RESULT eDVBServicePlay::getSubservice(eServiceReference &sub, unsigned int n) ePtr evt; if (!m_event_handler.getEvent(evt, 0)) { - if (!evt->getLinkageService(sub, n)) - { - eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) sub; - eServiceReferenceDVB ¤t = (eServiceReferenceDVB&) m_reference; - subservice.setDVBNamespace(current.getDVBNamespace()); - if ( current.getParentTransportStreamID().get() ) - { - subservice.setParentTransportStreamID( current.getParentTransportStreamID() ); - subservice.setParentServiceID( current.getParentServiceID() ); - } - else - { - subservice.setParentTransportStreamID( current.getTransportStreamID() ); - subservice.setParentServiceID( current.getServiceID() ); - } - if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() && - subservice.getParentServiceID() == subservice.getServiceID() ) - { - subservice.setParentTransportStreamID( eTransportStreamID(0) ); - subservice.setParentServiceID( eServiceID(0) ); - } + if (!evt->getLinkageService(sub, m_reference, n)) return 0; - } } sub.type=eServiceReference::idInvalid; return -1;