aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/demux.cpp
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-11-02 16:58:28 +0100
committerghost <andreas.monzner@multimedia-labs.de>2010-11-02 16:58:28 +0100
commitd9b377f518c0f8da868e0f40b8fcfd6799cbef62 (patch)
treed94ff76e16873278e837f0919f85c9edf9a3b7d5 /lib/dvb/demux.cpp
parent2e31046a8173d277326b070b7fdb99c95a1a9a84 (diff)
parenta83125b3e0f7fcfcb06f19e2d1eb086ba792d227 (diff)
downloadenigma2-d9b377f518c0f8da868e0f40b8fcfd6799cbef62.tar.gz
enigma2-d9b377f518c0f8da868e0f40b8fcfd6799cbef62.zip
Merge branch 'bug_612_fix_timeshift_stop' into 3.0
Diffstat (limited to 'lib/dvb/demux.cpp')
-rw-r--r--lib/dvb/demux.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/dvb/demux.cpp b/lib/dvb/demux.cpp
index 081059b9..0c736c55 100644
--- a/lib/dvb/demux.cpp
+++ b/lib/dvb/demux.cpp
@@ -648,18 +648,36 @@ RESULT eDVBTSRecorder::setBoundary(off_t max)
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;
+
+#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();
-
- close(m_source_fd);
+
+ if (state & 3)
+ ::close(m_source_fd);
+
+ m_running = 0;
m_source_fd = -1;
-
+
m_thread->stopSaveMetaInformation();
-
return 0;
}