X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/96844b5bd92b331390597061efe140172979c34d..ce38faaf7ce4c1320fa42109c13a60d74ab8cd9c:/lib/dvb/tstools.cpp diff --git a/lib/dvb/tstools.cpp b/lib/dvb/tstools.cpp index c7d9a417..1403059f 100644 --- a/lib/dvb/tstools.cpp +++ b/lib/dvb/tstools.cpp @@ -35,17 +35,17 @@ eDVBTSTools::~eDVBTSTools() int eDVBTSTools::openFile(const char *filename, int nostreaminfo) { eRawFile *f = new eRawFile(); - ePtr src = f; + ePtr src = f; if (f->open(filename, 1) < 0) return -1; - setSource(src, filename); + setSource(src, nostreaminfo ? NULL : filename); return 0; } -void eDVBTSTools::setSource(ePtr &source, const char *stream_info_filename) +void eDVBTSTools::setSource(ePtr &source, const char *stream_info_filename) { closeFile(); @@ -91,7 +91,7 @@ int eDVBTSTools::getPTS(off_t &offset, pts_t &pts, int fixed) if (!m_streaminfo.getPTS(offset, pts)) return 0; - if (!m_source->valid()) + if (!m_source || !m_source->valid()) return -1; offset -= offset % 188; @@ -411,7 +411,7 @@ int eDVBTSTools::getNextAccessPoint(pts_t &ts, const pts_t &start, int direction void eDVBTSTools::calcBegin() { - if (!m_source->valid()) + if (!m_source || !m_source->valid()) return; if (!(m_begin_valid || m_futile)) @@ -426,7 +426,7 @@ void eDVBTSTools::calcBegin() void eDVBTSTools::calcEnd() { - if (!m_source->valid()) + if (!m_source || !m_source->valid()) return; off_t end = m_source->lseek(0, SEEK_END); @@ -579,7 +579,7 @@ int eDVBTSTools::takeSample(off_t off, pts_t &p) int eDVBTSTools::findPMT(int &pmt_pid, int &service_id) { /* FIXME: this will be factored out soon! */ - if (!m_source->valid()) + if (!m_source || !m_source->valid()) { eDebug(" file not valid"); return -1;