use video stc for display. make skipping look a bit better.
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 20 Dec 2005 01:05:02 +0000 (01:05 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 20 Dec 2005 01:05:02 +0000 (01:05 +0000)
lib/dvb/demux.cpp
lib/dvb/demux.h
lib/dvb/dvb.cpp
lib/dvb/dvb.h
lib/dvb/idvb.h
lib/python/Screens/InfoBarGenerics.py
lib/service/servicedvb.cpp

index d7fcacc..78c55bf 100644 (file)
@@ -96,7 +96,7 @@ RESULT eDVBDemux::getMPEGDecoder(ePtr<iTSMPEGDecoder> &decoder)
        return 0;
 }
 
        return 0;
 }
 
-RESULT eDVBDemux::getSTC(pts_t &pts)
+RESULT eDVBDemux::getSTC(pts_t &pts, int num)
 {
        int fd = openDemux();
        
 {
        int fd = openDemux();
        
@@ -104,7 +104,7 @@ RESULT eDVBDemux::getSTC(pts_t &pts)
                return -ENODEV;
 
        struct dmx_stc stc;
                return -ENODEV;
 
        struct dmx_stc stc;
-       stc.num = 0;
+       stc.num = num;
        stc.base = 1;
        
        if (ioctl(fd, DMX_GET_STC, &stc) < 0)
        stc.base = 1;
        
        if (ioctl(fd, DMX_GET_STC, &stc) < 0)
index d3a369f..869c2e9 100644 (file)
@@ -20,7 +20,7 @@ public:
        RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
        RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder);
        RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader);
        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);
        RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
        RESULT flush();
        RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
index 0a5bb45..7e937e6 100644 (file)
@@ -702,7 +702,7 @@ RESULT eDVBChannel::getLength(pts_t &len)
        return m_tstools.calcLen(len);
 }
 
        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;
 {
        if (!decoding_demux)
                return -1;
@@ -718,7 +718,8 @@ RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos)
        
        pts_t now;
        
        
        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 (r)
        {
@@ -753,7 +754,7 @@ RESULT eDVBChannel::seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts)
        if (relative)
        {
                pts_t now;
        if (relative)
        {
                pts_t now;
-               if (getCurrentPosition(decoding_demux, now))
+               if (getCurrentPosition(decoding_demux, now, 0))
                {
                        eDebug("seekTo: getCurrentPosition failed!");
                        return -1;
                {
                        eDebug("seekTo: getCurrentPosition failed!");
                        return -1;
index a7be0a7..23dd777 100644 (file)
@@ -215,7 +215,7 @@ public:
                /* iDVBPVRChannel */
        RESULT playFile(const char *file);
        RESULT getLength(pts_t &len);
                /* 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 */
        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 */
index 6c45bb2..93d3b52 100644 (file)
@@ -429,7 +429,7 @@ public:
                   can be shared between multiple decoders.
                   Of couse skipping doesn't make much sense 
                   then, but getCurrentPosition does. */
                   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 seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts) = 0;
        virtual RESULT seekToPosition(iDVBDemux *decoding_demux, const off_t &pts) = 0;
 };
@@ -444,7 +444,7 @@ public:
        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 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;
 };
        virtual RESULT getCADemuxID(uint8_t &id)=0;
        virtual RESULT flush()=0;
 };
index 4f1cd99..6778163 100644 (file)
@@ -451,9 +451,9 @@ class InfoBarPVR:
        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_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)
        
        SEEK_STATE_BACK_4X = (0, 0, 0, -4)
        SEEK_STATE_BACK_32X = (0, 0, 0, -32)
index 778892f..4b7ee85 100644 (file)
@@ -767,7 +767,7 @@ RESULT eDVBServicePlay::getPlayPosition(pts_t &pos)
        if (!demux)
                return -1;
        
        if (!demux)
                return -1;
        
-       return pvr_channel->getCurrentPosition(demux, pos);
+       return pvr_channel->getCurrentPosition(demux, pos, 1);
 }
 
 RESULT eDVBServicePlay::setTrickmode(int trick)
 }
 
 RESULT eDVBServicePlay::setTrickmode(int trick)