aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/demux.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2009-02-11 12:52:48 +0100
committerFelix Domke <tmbinc@elitedvb.net>2009-02-11 12:52:48 +0100
commitbbfcb7ea1f040d030277e2b6f2efa9ea0967bf2b (patch)
treec5945c791698c14723e989449e6b4bfcc275c05d /lib/dvb/demux.cpp
parent4f7990ff2a55874b9eb65e3c9cd47dacb9f76deb (diff)
parent5e6f814d005a01caa437a532e61f4b338617ff67 (diff)
downloadenigma2-bbfcb7ea1f040d030277e2b6f2efa9ea0967bf2b.tar.gz
enigma2-bbfcb7ea1f040d030277e2b6f2efa9ea0967bf2b.zip
Merge branch 'master' of /home/tmbinc/enigma2-git into tmbinc/FixTimingBugs
Conflicts: lib/dvb/decoder.cpp
Diffstat (limited to 'lib/dvb/demux.cpp')
-rw-r--r--lib/dvb/demux.cpp19
1 files changed, 19 insertions, 0 deletions
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 &current_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 &current_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<void,int> &event, ePtr<eConnection> &conn)
{
conn = new eConnection(this, m_event.connect(event));