diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-11-18 02:52:38 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-11-18 02:52:38 +0000 |
| commit | 81b381e1f5dd38ad1b80a3b3d96060b89a5fab6c (patch) | |
| tree | 7571dc684941d1aa125d858433c5a5d3f4b2902d /lib/dvb | |
| parent | fb64ecb2733e4e4ebbc180466c4202645f18f9bc (diff) | |
| download | enigma2-81b381e1f5dd38ad1b80a3b3d96060b89a5fab6c.tar.gz enigma2-81b381e1f5dd38ad1b80a3b3d96060b89a5fab6c.zip | |
pts: as the decoding demux isn't stored in the dvbchannel (it could be shared, and a decoding demux can't be shared), it has to be given to the pts relevant functions.
Diffstat (limited to 'lib/dvb')
| -rw-r--r-- | lib/dvb/dvb.cpp | 20 | ||||
| -rw-r--r-- | lib/dvb/dvb.h | 6 | ||||
| -rw-r--r-- | lib/dvb/idvb.h | 11 | ||||
| -rw-r--r-- | lib/dvb/pmt.cpp | 2 |
4 files changed, 23 insertions, 16 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 5ede1e38..04c2b40e 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -583,7 +583,7 @@ RESULT eDVBChannel::playFile(const char *file) m_pvr_fd_dst = open("/dev/misc/pvr", O_WRONLY); if (m_pvr_fd_dst < 0) { - eDebug("can't open /dev/misc/pvr - you need to buy the new(!) $$$ box! (%m)"); + eDebug("can't open /dev/misc/pvr - you need to buy the new(!) $$$ box! (%m)"); // or wait for the driver to be improved. return -ENODEV; } @@ -609,9 +609,9 @@ RESULT eDVBChannel::getLength(pts_t &len) return m_tstools.calcLen(len); } -RESULT eDVBChannel::getCurrentPosition(pts_t &pos) +RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos) { - if (!m_decoder_demux) + if (!decoding_demux) return -1; off_t begin = 0; @@ -625,7 +625,7 @@ RESULT eDVBChannel::getCurrentPosition(pts_t &pos) pts_t now; - r = m_decoder_demux->get().getSTC(now); + r = decoding_demux->getSTC(now); if (r) { @@ -650,7 +650,7 @@ RESULT eDVBChannel::getCurrentPosition(pts_t &pos) return 0; } -RESULT eDVBChannel::seekTo(int relative, pts_t &pts) +RESULT eDVBChannel::seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts) { int bitrate = m_tstools.calcBitrate(); /* in bits/s */ @@ -660,7 +660,7 @@ RESULT eDVBChannel::seekTo(int relative, pts_t &pts) if (relative) { pts_t now; - if (getCurrentPosition(now)) + if (getCurrentPosition(decoding_demux, now)) { eDebug("seekTo: getCurrentPosition failed!"); return -1; @@ -673,11 +673,11 @@ RESULT eDVBChannel::seekTo(int relative, pts_t &pts) off_t offset = (pts * (pts_t)bitrate) / 8ULL / 90000ULL; - seekToPosition(offset); + seekToPosition(decoding_demux, offset); return 0; } -RESULT eDVBChannel::seekToPosition(const off_t &r) +RESULT eDVBChannel::seekToPosition(iDVBDemux *decoding_demux, const off_t &r) { /* when seeking, we have to ensure that all buffers are flushed. there are basically 3 buffers: @@ -699,8 +699,8 @@ RESULT eDVBChannel::seekToPosition(const off_t &r) ::ioctl(m_pvr_fd_dst, 0); /* flush ratebuffers (video, audio) */ - if (m_decoder_demux) - m_decoder_demux->get().flush(); + if (decoding_demux) + decoding_demux->flush(); /* demux will also flush all decoder.. */ m_pvr_thread->seek(SEEK_SET, r); diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index 03702db2..924d4e6e 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -191,11 +191,11 @@ public: /* iDVBPVRChannel */ RESULT playFile(const char *file); RESULT getLength(pts_t &len); - RESULT getCurrentPosition(pts_t &pos); - RESULT seekTo(int relative, pts_t &pts); + RESULT getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos); + 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 seekToPosition(const off_t &off); + RESULT seekToPosition(iDVBDemux *decoding_demux, const off_t &off); private: ePtr<eDVBAllocatedFrontend> m_frontend; diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index 483c395b..699474d3 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -410,9 +410,14 @@ public: virtual RESULT playFile(const char *file) = 0; virtual RESULT getLength(pts_t &pts) = 0; - virtual RESULT getCurrentPosition(pts_t &pos) = 0; - virtual RESULT seekTo(int relative, pts_t &pts) = 0; - virtual RESULT seekToPosition(const off_t &pts) = 0; + + /* we explicitely ask for the decoding demux here because a channel + 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 seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts) = 0; + virtual RESULT seekToPosition(iDVBDemux *decoding_demux, const off_t &pts) = 0; }; class iDVBSectionReader; diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index e743d266..6fb2d1cc 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -12,10 +12,12 @@ eDVBServicePMTHandler::eDVBServicePMTHandler(int record) eDVBResourceManager::getInstance(m_resourceManager); CONNECT(m_PMT.tableReady, eDVBServicePMTHandler::PMTready); CONNECT(m_PAT.tableReady, eDVBServicePMTHandler::PATready); + eDebug("new PMT handler record: %d", m_record); } eDVBServicePMTHandler::~eDVBServicePMTHandler() { + eDebug("delete PMT handler record: %d", m_record); delete m_ca_servicePtr; } |
