X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb%2Fdvb.cpp;h=68197c31e4e1a8ea27b1d258db5341e5dbe4c552;hp=516294523be74848efe99c80952296adf628a58a;hb=be4aa74e26480dc08d7eb4ea2565fc02d0b1e414;hpb=7dd3be2ced167827d6e2555a23e98304a10640bc diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp old mode 100644 new mode 100755 index 5162945..68197c3 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -1184,8 +1184,22 @@ void eDVBChannel::frontendStateChanged(iDVBFrontend*fe) } } else if (state == iDVBFrontend::stateFailed) { +#ifdef BUILD_VUPLUS /* ikseong */ + if (m_current_frontend_parameters) + { + eDebug("OURSTATE: lost lock, trying to retune"); + ourstate = state_tuning; + m_frontend->get().tune(*m_current_frontend_parameters); + } + else + { + eDebug("OURSTATE: failed"); + ourstate = state_failed; + } +#else eDebug("OURSTATE: failed"); ourstate = state_failed; +#endif } else eFatal("state unknown"); @@ -1752,6 +1766,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,7 +1788,13 @@ RESULT eDVBChannel::playFile(const char *file) m_pvr_thread = 0; } - m_tstools.openFile(file); + if (!source->valid()) + { + eDebug("PVR source is not valid!"); + return -ENOENT; + } + + m_tstools.setSource(source, streaminfo_file); /* DON'T EVEN THINK ABOUT FIXING THIS. FIX THE ATI SOURCES FIRST, THEN DO A REAL FIX HERE! */ @@ -1787,15 +1821,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 +1830,7 @@ RESULT eDVBChannel::playFile(const char *file) return 0; } -void eDVBChannel::stopFile() +void eDVBChannel::stopSource() { if (m_pvr_thread) { @@ -1814,6 +1840,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)