#include <stdio.h>
eDVBTSTools::eDVBTSTools()
+ :m_file_lock(true)
{
m_pid = -1;
m_maxrange = 256*1024;
m_samples_taken = 0;
+ eSingleLocker l(m_file_lock);
if (m_file.open(filename, 1) < 0)
return -1;
return 0;
void eDVBTSTools::closeFile()
{
+ eSingleLocker l(m_file_lock);
m_file.close();
}
return -1;
offset -= offset % 188;
-
+
+ eSingleLocker l(m_file_lock);
if (m_file.lseek(offset, SEEK_SET) < 0)
{
eDebug("lseek failed");
{
if (!m_file.valid())
return;
-
+
+ eSingleLocker l(m_file_lock);
off_t end = m_file.lseek(0, SEEK_END);
if (llabs(end - m_last_filelength) > 1*1024*1024)
return -1;
}
+ eSingleLocker l(m_file_lock);
if (m_file.lseek(0, SEEK_SET) < 0)
{
eDebug("seek failed");
#include <sys/types.h>
#include <lib/dvb/pvrparse.h>
#include <lib/base/rawfile.h>
+#include <lib/base/elock.h>
/*
* Note: we're interested in PTS values, not STC values.
private:
int m_pid;
int m_maxrange;
-
+
+ eSingleLock m_file_lock;
eRawFile m_file;
-
+
int m_begin_valid, m_end_valid;
pts_t m_pts_begin, m_pts_end;
off_t m_offset_begin, m_offset_end;