git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make switching of keyboard modes more consistent
[enigma2.git]
/
lib
/
dvb
/
demux.cpp
diff --git
a/lib/dvb/demux.cpp
b/lib/dvb/demux.cpp
index 081059b95bc8a5bd949493930d8e940a2732f8f8..f4d86185b508a03461075f17bd119cd911005e60 100644
(file)
--- a/
lib/dvb/demux.cpp
+++ b/
lib/dvb/demux.cpp
@@
-85,6
+85,13
@@
int eDVBDemux::openDemux(void)
return ::open(filename, O_RDWR);
}
return ::open(filename, O_RDWR);
}
+int eDVBDemux::openDVR(int flags)
+{
+ char filename[128];
+ snprintf(filename, 128, "/dev/dvb/adapter%d/dvr%d", adapter, demux);
+ return ::open(filename, flags);
+}
+
DEFINE_REF(eDVBDemux)
RESULT eDVBDemux::setSourceFrontend(int fenum)
DEFINE_REF(eDVBDemux)
RESULT eDVBDemux::setSourceFrontend(int fenum)
@@
-648,18
+655,36
@@
RESULT eDVBTSRecorder::setBoundary(off_t max)
RESULT eDVBTSRecorder::stop()
{
RESULT eDVBTSRecorder::stop()
{
+ int state=3;
+
for (std::map<int,int>::iterator i(m_pids.begin()); i != m_pids.end(); ++i)
stopPID(i->first);
if (!m_running)
return -1;
for (std::map<int,int>::iterator i(m_pids.begin()); i != m_pids.end(); ++i)
stopPID(i->first);
if (!m_running)
return -1;
+
+#if HAVE_DVB_API_VERSION >= 5
+ /* workaround for record thread stop */
+ if (::ioctl(m_source_fd, DMX_STOP) < 0)
+ perror("DMX_STOP");
+ else
+ state &= ~1;
+
+ if (::close(m_source_fd) < 0)
+ perror("close");
+ else
+ state &= ~2;
+#endif
+
m_thread->stop();
m_thread->stop();
-
- close(m_source_fd);
+
+ if (state & 3)
+ ::close(m_source_fd);
+
+ m_running = 0;
m_source_fd = -1;
m_source_fd = -1;
-
+
m_thread->stopSaveMetaInformation();
m_thread->stopSaveMetaInformation();
-
return 0;
}
return 0;
}