X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/556d6244747ea2b4b3590e682948e9f708b0a069..d6f965e34c0e482e5579689ee3150788dad3067f:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 2cece3eb..a57a813b 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -1223,6 +1223,7 @@ RESULT eDVBServicePlay::setFastForward_internal(int ratio) return m_decoder->setFastForward(ffratio); else return m_decoder->setTrickmode(); + return 0; } RESULT eDVBServicePlay::seek(ePtr &ptr) @@ -1558,10 +1559,34 @@ int eDVBServicePlay::getInfo(int w) break; } case sIsCrypted: if (no_program_info) return -1; return program.isCrypted(); - case sVideoPID: if (no_program_info) return -1; if (program.videoStreams.empty()) return -1; return program.videoStreams[0].pid; + case sVideoPID: + if (m_dvb_service) + { + int vpid = m_dvb_service->getCacheEntry(eDVBService::cVPID); + if (vpid != -1) + return vpid; + } + if (no_program_info) return -1; if (program.videoStreams.empty()) return -1; return program.videoStreams[0].pid; case sVideoType: if (no_program_info) return -1; if (program.videoStreams.empty()) return -1; return program.videoStreams[0].type; - case sAudioPID: if (no_program_info) return -1; if (program.audioStreams.empty()) return -1; return program.audioStreams[0].pid; - case sPCRPID: if (no_program_info) return -1; return program.pcrPid; + case sAudioPID: + if (m_dvb_service) + { + int apid = m_dvb_service->getCacheEntry(eDVBService::cAPID); + if (apid != -1) + return apid; + apid = m_dvb_service->getCacheEntry(eDVBService::cAC3PID); + if (apid != -1) + return apid; + } + if (no_program_info) return -1; if (program.audioStreams.empty()) return -1; return program.audioStreams[0].pid; + case sPCRPID: + if (m_dvb_service) + { + int pcrpid = m_dvb_service->getCacheEntry(eDVBService::cPCRPID); + if (pcrpid != -1) + return pcrpid; + } + if (no_program_info) return -1; return program.pcrPid; case sPMTPID: if (no_program_info) return -1; return program.pmtPid; case sTXTPID: if (no_program_info) return -1; return program.textPid; case sSID: return ((const eServiceReferenceDVB&)m_reference).getServiceID().get(); @@ -1713,7 +1738,7 @@ int eDVBServicePlay::selectAudioStream(int i) m_current_audio_pid = apid; - if (m_decoder->setAudioPID(apid, apidtype)) + if (m_is_primary && m_decoder->setAudioPID(apid, apidtype)) { eDebug("set audio pid failed"); return -4; @@ -2185,6 +2210,7 @@ void eDVBServicePlay::switchToLive() m_new_subtitle_page_connection = 0; m_rds_decoder_event_connection = 0; m_video_event_connection = 0; + m_is_paused = m_skipmode = 0; /* not supported in live mode */ /* free the timeshift service handler, we need the resources */ m_service_handler_timeshift.free(); @@ -2283,6 +2309,9 @@ void eDVBServicePlay::updateDecoder() m_decode_demux->getMPEGDecoder(m_decoder, m_is_primary); if (m_decoder) m_decoder->connectVideoEvent(slot(*this, &eDVBServicePlay::video_event), m_video_event_connection); + } + if (m_decode_demux && m_is_primary) + { m_teletext_parser = new eDVBTeletextParser(m_decode_demux); m_teletext_parser->connectNewPage(slot(*this, &eDVBServicePlay::newSubtitlePage), m_new_subtitle_page_connection); m_subtitle_parser = new eDVBSubtitleParser(m_decode_demux); @@ -2351,9 +2380,11 @@ void eDVBServicePlay::updateDecoder() else m_decoder->setSyncPCR(-1); - m_decoder->setTextPID(tpid); - - m_teletext_parser->start(program.textPid); + if (m_is_primary) + { + m_decoder->setTextPID(tpid); + m_teletext_parser->start(program.textPid); + } if (vpid > 0 && vpid < 0x2000) ; @@ -2793,17 +2824,21 @@ void eDVBServicePlay::checkSubtitleTiming() m_decoder->getPTS(0, pos); eDebug("%lld %lld", pos, show_time); - int diff = show_time - pos; + int diff = show_time - pos; if (diff < 0) { eDebug("[late (%d ms)]", -diff / 90); diff = 0; } -// if (diff > 900000) -// { -// eDebug("[invalid]"); -// diff = 0; -// } + if (abs(diff) > 1800000) + { + eDebug("skip [invalid]"); + if (type == TELETEXT) + m_subtitle_pages.pop_front(); + else + m_dvb_subtitle_pages.pop_front(); + continue; + } if ((diff/90)<20) {