int relative = seek.first;
pts_t pts = seek.second;
+ pts_t now = 0;
if (relative)
{
- pts_t now;
if (!m_cue->m_decoder)
{
eDebug("no decoder - can't seek relative");
eDebug("seekTo: getCurrentPosition failed!");
continue;
}
- pts += now;
}
+
+ if (relative == 1) /* pts relative */
+ pts += now;
- if (pts < 0)
- pts = 0;
+ if (relative != 2)
+ if (pts < 0)
+ pts = 0;
+
+ if (relative == 2) /* AP relative */
+ {
+ eDebug("AP relative seeking: %lld, at %lld", pts, now);
+ pts_t nextap;
+ if (m_tstools.getNextAccessPoint(nextap, now, pts))
+ {
+ pts = now;
+ eDebug("AP relative seeking failed!");
+ } else
+ {
+ eDebug("next ap is %llx\n", pts);
+ pts = nextap;
+ }
+ }
off_t offset = 0;
if (m_tstools.getOffset(offset, pts))
start = current_offset;
size = max;
eDebug("END OF CUESHEET. (%08llx, %d)", start, size);
-
- if (size < 4096)
- eFatal("blub");
return;
}
return -ENODEV;
}
- m_pvr_fd_src = open(file, O_RDONLY|O_LARGEFILE);
- if (m_pvr_fd_src < 0)
- {
- eDebug("can't open PVR m_pvr_fd_src file %s (%m)", file);
- close(m_pvr_fd_dst);
- return -ENOENT;
- }
-
m_state = state_ok;
m_stateChanged(this);
m_pvr_thread->enablePVRCommit(1);
m_pvr_thread->setScatterGather(this);
- m_pvr_thread->start(m_pvr_fd_src, m_pvr_fd_dst);
+ if (m_pvr_thread->start(file, m_pvr_fd_dst))
+ {
+ delete m_pvr_thread;
+ m_pvr_thread = 0;
+ eDebug("can't open PVR file %s (%m)", file);
+ return -ENOENT;
+ }
CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);
return 0;
if (m_pvr_thread)
{
m_pvr_thread->stop();
- ::close(m_pvr_fd_src);
::close(m_pvr_fd_dst);
delete m_pvr_thread;
m_pvr_thread = 0;