X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/10e7e45ae92d4fe06f70126ed256b87896dbc432..c668e555f7f57a878b8295abfeeb87d0f4550fbd:/lib/dvb/demux.cpp diff --git a/lib/dvb/demux.cpp b/lib/dvb/demux.cpp index a0f1c326..810b10a5 100644 --- a/lib/dvb/demux.cpp +++ b/lib/dvb/demux.cpp @@ -405,12 +405,14 @@ public: void setTimingPID(int pid); void saveTimingInformation(const std::string &filename); + int getLastPTS(pts_t &pts); protected: int filterRecordData(const unsigned char *data, int len, size_t ¤t_span_remaining); private: eMPEGStreamParserTS m_ts_parser; eMPEGStreamInformation m_stream_info; off_t m_current_offset; + pts_t m_last_pcr; /* very approximate.. */ int m_pid; }; @@ -430,6 +432,11 @@ void eDVBRecordFileThread::saveTimingInformation(const std::string &filename) m_stream_info.save(filename.c_str()); } +int eDVBRecordFileThread::getLastPTS(pts_t &pts) +{ + return m_ts_parser.getLastPTS(pts); +} + int eDVBRecordFileThread::filterRecordData(const unsigned char *data, int len, size_t ¤t_span_remaining) { m_ts_parser.parseData(m_current_offset, data, len); @@ -589,6 +596,18 @@ RESULT eDVBTSRecorder::stop() return 0; } +RESULT eDVBTSRecorder::getCurrentPCR(pts_t &pcr) +{ + if (!m_running) + return 0; + if (!m_thread) + return 0; + /* XXX: we need a lock here */ + + /* we don't filter PCR data, so just use the last received PTS, which is not accurate, but better than nothing */ + return m_thread->getLastPTS(pcr); +} + RESULT eDVBTSRecorder::connectEvent(const Slot1 &event, ePtr &conn) { conn = new eConnection(this, m_event.connect(event));