X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb%2Fdvb.cpp;h=414ab8da7d9419f37b86d722bf7617523ccb3cea;hp=1807b87e0866cf95a838e12016f1956b4b91bccf;hb=30da484f79db1d8210a3dcb31b359484873dc240;hpb=2f085dd58effc19da8e5fec68bb5d73b0b64eb3f diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 1807b87..414ab8d 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -1752,6 +1752,20 @@ RESULT eDVBChannel::getCurrentFrontendParameters(ePtr &p RESULT eDVBChannel::playFile(const char *file) { + eRawFile *f = new eRawFile(); + ePtr source = f; + + if (f->open(file) < 0) + { + eDebug("can't open PVR file %s (%m)", file); + return -ENOENT; + } + + return playSource(source, file); +} + +RESULT eDVBChannel::playSource(ePtr &source, const char *streaminfo_file) +{ ASSERT(!m_frontend); if (m_pvr_thread) { @@ -1760,15 +1774,13 @@ RESULT eDVBChannel::playFile(const char *file) m_pvr_thread = 0; } - eRawFile *f = new eRawFile(); - if (f->open(file) < 0) + if (!source->valid()) { - eDebug("can't open PVR file %s (%m)", file); + eDebug("PVR source is not valid!"); return -ENOENT; } - ePtr source = f; - m_tstools.setSource(source, file); + m_tstools.setSource(source, streaminfo_file); /* DON'T EVEN THINK ABOUT FIXING THIS. FIX THE ATI SOURCES FIRST, THEN DO A REAL FIX HERE! */ @@ -1804,7 +1816,7 @@ RESULT eDVBChannel::playFile(const char *file) return 0; } -void eDVBChannel::stopFile() +void eDVBChannel::stopSource() { if (m_pvr_thread) { @@ -1814,6 +1826,13 @@ void eDVBChannel::stopFile() } if (m_pvr_fd_dst >= 0) ::close(m_pvr_fd_dst); + ePtr d; + m_tstools.setSource(d); +} + +void eDVBChannel::stopFile() +{ + stopSource(); } void eDVBChannel::setCueSheet(eCueSheet *cuesheet)