return 0;
}
-RESULT eDVBDemux::getSTC(pts_t &pts)
+RESULT eDVBDemux::getSTC(pts_t &pts, int num)
{
int fd = openDemux();
return -ENODEV;
struct dmx_stc stc;
- stc.num = 0;
+ stc.num = num;
stc.base = 1;
if (ioctl(fd, DMX_GET_STC, &stc) < 0)
RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder);
RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader);
- RESULT getSTC(pts_t &pts);
+ RESULT getSTC(pts_t &pts, int num);
RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
RESULT flush();
RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
return m_tstools.calcLen(len);
}
-RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos)
+RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode)
{
if (!decoding_demux)
return -1;
pts_t now;
- r = decoding_demux->getSTC(now);
+ /* TODO: this is a gross hack. */
+ r = decoding_demux->getSTC(now, mode ? 128 : 0);
if (r)
{
if (relative)
{
pts_t now;
- if (getCurrentPosition(decoding_demux, now))
+ if (getCurrentPosition(decoding_demux, now, 0))
{
eDebug("seekTo: getCurrentPosition failed!");
return -1;
/* iDVBPVRChannel */
RESULT playFile(const char *file);
RESULT getLength(pts_t &len);
- RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos);
+ RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode);
RESULT seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts);
/* seeking to relative positions won't work -
there is an unknown amount of buffers in between */
can be shared between multiple decoders.
Of couse skipping doesn't make much sense
then, but getCurrentPosition does. */
- virtual RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos) = 0;
+ virtual RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode) = 0;
virtual RESULT seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts) = 0;
virtual RESULT seekToPosition(iDVBDemux *decoding_demux, const off_t &pts) = 0;
};
virtual RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader)=0;
virtual RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder)=0;
virtual RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader)=0;
- virtual RESULT getSTC(pts_t &pts)=0;
+ virtual RESULT getSTC(pts_t &pts, int num=0)=0;
virtual RESULT getCADemuxID(uint8_t &id)=0;
virtual RESULT flush()=0;
};
SEEK_STATE_FF_2X = (0, 2, 0, 0)
SEEK_STATE_FF_4X = (0, 4, 0, 0)
SEEK_STATE_FF_8X = (0, 8, 0, 0)
- SEEK_STATE_FF_32X = (0, 0, 0, 32)
- SEEK_STATE_FF_64X = (0, 0, 0, 64)
- SEEK_STATE_FF_128X = (0, 0, 0, 128)
+ SEEK_STATE_FF_32X = (0, 4, 0, 32)
+ SEEK_STATE_FF_64X = (0, 4, 0, 64)
+ SEEK_STATE_FF_128X = (0, 4, 0, 128)
SEEK_STATE_BACK_4X = (0, 0, 0, -4)
SEEK_STATE_BACK_32X = (0, 0, 0, -32)
if (!demux)
return -1;
- return pvr_channel->getCurrentPosition(demux, pos);
+ return pvr_channel->getCurrentPosition(demux, pos, 1);
}
RESULT eDVBServicePlay::setTrickmode(int trick)