X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb%2Fdvb.cpp;h=640f327cf5b8d4409c9fbbb81d7c84b48f6bd6e0;hp=516294523be74848efe99c80952296adf628a58a;hb=7d044888ef99903c5cb880cc5a83d03336726ea2;hpb=0cc396a9dd3478a71b7a0bff4f5a6fdfbc52f22d diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 5162945..640f327 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 *priv) +{ ASSERT(!m_frontend); if (m_pvr_thread) { @@ -1760,7 +1774,7 @@ RESULT eDVBChannel::playFile(const char *file) m_pvr_thread = 0; } - m_tstools.openFile(file); + m_tstools.setSource(source, priv); /* DON'T EVEN THINK ABOUT FIXING THIS. FIX THE ATI SOURCES FIRST, THEN DO A REAL FIX HERE! */ @@ -1787,15 +1801,7 @@ RESULT eDVBChannel::playFile(const char *file) m_event(this, evtPreStart); - if (m_pvr_thread->start(file, m_pvr_fd_dst)) - { - delete m_pvr_thread; - m_pvr_thread = 0; - ::close(m_pvr_fd_dst); - m_pvr_fd_dst = -1; - eDebug("can't open PVR file %s (%m)", file); - return -ENOENT; - } + m_pvr_thread->start(source, m_pvr_fd_dst); CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent); m_state = state_ok; @@ -1804,7 +1810,7 @@ RESULT eDVBChannel::playFile(const char *file) return 0; } -void eDVBChannel::stopFile() +void eDVBChannel::stopSource() { if (m_pvr_thread) { @@ -1816,6 +1822,11 @@ void eDVBChannel::stopFile() ::close(m_pvr_fd_dst); } +void eDVBChannel::stopFile() +{ + stopSource(); +} + void eDVBChannel::setCueSheet(eCueSheet *cuesheet) { m_conn_cueSheetEvent = 0;