/* if you want to do several seeks in a row, you can enable the trickmode.
audio will be switched off, sync will be disabled etc. */
virtual RESULT setTrickmode(int trick=0)=0;
+ virtual RESULT isCurrentlySeekable()=0;
};
TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
RESULT eDVBServicePlay::seek(ePtr<iSeekableService> &ptr)
{
- if (m_is_pvr || m_timeshift_active)
+ if (m_is_pvr || m_timeshift_enabled)
{
ptr = this;
return 0;
return -1;
}
+ /* TODO: when timeshift is enabled but not active, this doesn't work. */
RESULT eDVBServicePlay::getLength(pts_t &len)
{
ePtr<iDVBPVRChannel> pvr_channel;
- if (m_service_handler.getPVRChannel(pvr_channel))
- {
- eDebug("getPVRChannel failed!");
+ if ((m_timeshift_enabled ? m_service_handler_timeshift : m_service_handler).getPVRChannel(pvr_channel))
return -1;
- }
return pvr_channel->getLength(len);
}
return 0;
}
+RESULT eDVBServicePlay::isCurrentlySeekable()
+{
+ return m_is_pvr || m_timeshift_active;
+}
+
RESULT eDVBServicePlay::frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr)
{
ptr = this;
m_record = 0;
close(m_timeshift_fd);
+ eDebug("remove timeshift file");
remove(m_timeshift_file.c_str());
return 0;
RESULT seekRelative(int direction, pts_t to);
RESULT getPlayPosition(pts_t &pos);
RESULT setTrickmode(int trick=0);
+ RESULT isCurrentlySeekable();
// iServiceInformation
RESULT getName(std::string &name);