m_is_pvr = !m_reference.path.empty();
m_timeshift_enabled = m_timeshift_active = 0, m_timeshift_changed = 0;
- m_skipmode = 0;
+ m_skipmode = m_fastforward = m_slowmotion = 0;
CONNECT(m_service_handler.serviceEvent, eDVBServicePlay::serviceEvent);
CONNECT(m_service_handler_timeshift.serviceEvent, eDVBServicePlay::serviceEventTimeshift);
eDebug("eDVBServicePlay::setSlowMotion(%d)", ratio);
setFastForward_internal(0);
if (m_decoder)
+ {
+ m_slowmotion = ratio;
return m_decoder->setSlowMotion(ratio);
+ }
else
return -1;
}
return setFastForward_internal(ratio);
}
-RESULT eDVBServicePlay::setFastForward_internal(int ratio)
+RESULT eDVBServicePlay::setFastForward_internal(int ratio, bool final_seek)
{
- int skipmode, ffratio;
-
+ int skipmode, ffratio, ret = 0;
+ pts_t pos=0;
+
if (ratio > 8)
{
skipmode = ratio;
if (m_cue)
m_cue->setSkipmode(skipmode * 90000); /* convert to 90000 per second */
}
-
+
m_skipmode = skipmode;
-
+
+ if (final_seek)
+ eDebug("trickplay stopped .. ret %d, pos %lld", getPlayPosition(pos), pos);
+
+ m_fastforward = ffratio;
+
if (!m_decoder)
return -1;
-
+
if (ffratio == 0)
; /* return m_decoder->play(); is done in caller*/
else if (ffratio != 1)
- return m_decoder->setFastForward(ffratio);
+ ret = m_decoder->setFastForward(ffratio);
else
- return m_decoder->setTrickmode();
- return 0;
+ ret = m_decoder->setTrickmode();
+
+ if (pos)
+ eDebug("final seek after trickplay ret %d", seekTo(pos));
+
+ return ret;
}
RESULT eDVBServicePlay::seek(ePtr<iSeekableService> &ptr)
RESULT eDVBServicePlay::unpause()
{
eDebug("eDVBServicePlay::unpause");
- setFastForward_internal(0);
+ setFastForward_internal(0, m_slowmotion || m_fastforward > 1);
if (m_decoder)
{
+ m_slowmotion = 0;
m_is_paused = 0;
return m_decoder->play();
} else
RESULT eDVBServicePlay::isCurrentlySeekable()
{
- return m_is_pvr || m_timeshift_active ? 3 : 0; // fast forward/backward possible and seeking possible
+ return m_is_pvr || m_timeshift_active;
}
RESULT eDVBServicePlay::frontendInfo(ePtr<iFrontendInformation> &ptr)
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 */
+ m_is_paused = m_skipmode = m_fastforward = m_slowmotion = 0; /* not supported in live mode */
/* free the timeshift service handler, we need the resources */
m_service_handler_timeshift.free();
}
}
- std::string config_delay;
- int config_delay_int = 0;
- if(ePythonConfigQuery::getConfigValue("config.av.generalAC3delay", config_delay) == 0)
- config_delay_int = atoi(config_delay.c_str());
- m_decoder->setAC3Delay(ac3_delay == -1 ? config_delay_int : ac3_delay + config_delay_int);
-
- if(ePythonConfigQuery::getConfigValue("config.av.generalPCMdelay", config_delay) == 0)
- config_delay_int = atoi(config_delay.c_str());
- else
- config_delay_int = 0;
- m_decoder->setPCMDelay(pcm_delay == -1 ? config_delay_int : pcm_delay + config_delay_int);
+ setAC3Delay(ac3_delay == -1 ? 0 : ac3_delay);
+ setPCMDelay(pcm_delay == -1 ? 0 : pcm_delay);
m_decoder->setVideoPID(vpid, vpidtype);
selectAudioStream();
{
if (m_dvb_service)
m_dvb_service->setCacheEntry(eDVBService::cAC3DELAY, delay ? delay : -1);
- if (m_decoder)
- m_decoder->setAC3Delay(delay);
+ if (m_decoder) {
+ std::string config_delay;
+ int config_delay_int = 0;
+ if(ePythonConfigQuery::getConfigValue("config.av.generalAC3delay", config_delay) == 0)
+ config_delay_int = atoi(config_delay.c_str());
+ m_decoder->setAC3Delay(delay + config_delay_int);
+ }
}
void eDVBServicePlay::setPCMDelay(int delay)
{
if (m_dvb_service)
m_dvb_service->setCacheEntry(eDVBService::cPCMDELAY, delay ? delay : -1);
- if (m_decoder)
- m_decoder->setPCMDelay(delay);
+ if (m_decoder) {
+ std::string config_delay;
+ int config_delay_int = 0;
+ if(ePythonConfigQuery::getConfigValue("config.av.generalPCMdelay", config_delay) == 0)
+ config_delay_int = atoi(config_delay.c_str());
+ else
+ config_delay_int = 0;
+ m_decoder->setPCMDelay(delay + config_delay_int);
+ }
}
void eDVBServicePlay::video_event(struct iTSMPEGDecoder::videoEvent event)