aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/dvb.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-11-13 18:25:50 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-11-13 18:25:50 +0000
commit158e6cd69d33bb56e4ae498f7799bd67ba7148d7 (patch)
treed396c0544d936d4d1049bb97c276743282d640ce /lib/dvb/dvb.cpp
parenta6d3a3d2a552e2846e8da5a03f7651c5c2e7d6b2 (diff)
downloadenigma2-158e6cd69d33bb56e4ae498f7799bd67ba7148d7.tar.gz
enigma2-158e6cd69d33bb56e4ae498f7799bd67ba7148d7.zip
flush PVR
Diffstat (limited to 'lib/dvb/dvb.cpp')
-rw-r--r--lib/dvb/dvb.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index a2a37758..31cf7720 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -9,6 +9,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/ioctl.h>
DEFINE_REF(eDVBRegisteredFrontend);
DEFINE_REF(eDVBRegisteredDemux);
@@ -638,10 +639,29 @@ RESULT eDVBChannel::seekTo(pts_t &pts)
RESULT eDVBChannel::seekToPosition(int relative, const off_t &r)
{
+ /* when seeking, we have to ensure that all buffers are flushed.
+ there are basically 3 buffers:
+ a.) the filepush's internal buffer
+ b.) the PVR buffer (before demux)
+ c.) the ratebuffer (after demux)
+
+ it's important to clear them in the correct order, otherwise
+ the ratebuffer (for example) would immediately refill from
+ the not-yet-flushed PVR buffer.
+ */
eDebug("eDVBChannel: seekToPosition .. %llx", r);
m_pvr_thread->pause();
+
+ /* flush internal filepush buffer */
+ m_pvr_thread->flush();
+
+ /* HACK: flush PVR buffer */
+ ::ioctl(m_pvr_fd_dst, 0);
+
+ /* flush ratebuffers (video, audio) */
if (m_decoder_demux)
m_decoder_demux->get().flush();
+
/* demux will also flush all decoder.. */
m_pvr_thread->seek(relative ? SEEK_CUR : SEEK_SET, r);
m_pvr_thread->resume();