return m_decoder->setFastForward(ffratio);
else
return m_decoder->setTrickmode();
+ return 0;
}
RESULT eDVBServicePlay::seek(ePtr<iSeekableService> &ptr)
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();
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;
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();
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);
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)
;
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)
{