aboutsummaryrefslogtreecommitdiff
path: root/lib/base/filepush.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-01-18 15:46:35 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-01-18 15:46:35 +0000
commit4a594e382e063bc9f313683d2bd6c679cbad0e9a (patch)
treea2dbf40d5de7c5c71d546822483c41110992840c /lib/base/filepush.cpp
parentb09455febeca3d10b9c55ee8720d0831a52e0d69 (diff)
downloadenigma2-4a594e382e063bc9f313683d2bd6c679cbad0e9a.tar.gz
enigma2-4a594e382e063bc9f313683d2bd6c679cbad0e9a.zip
experimental PVR commit support
Diffstat (limited to 'lib/base/filepush.cpp')
-rw-r--r--lib/base/filepush.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/base/filepush.cpp b/lib/base/filepush.cpp
index 7ab8c0d3..39319a24 100644
--- a/lib/base/filepush.cpp
+++ b/lib/base/filepush.cpp
@@ -3,11 +3,15 @@
#include <lib/base/eerror.h>
#include <errno.h>
#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#define PVR_COMMIT 1
eFilePushThread::eFilePushThread(): m_messagepump(eApp, 0)
{
m_stop = 0;
flush();
+ enablePVRCommit(0);
CONNECT(m_messagepump.recv_msg, eFilePushThread::recvEvent);
}
@@ -18,6 +22,8 @@ static void signal_handler(int x)
void eFilePushThread::thread()
{
off_t dest_pos = 0;
+
+ int already_empty = 0;
eDebug("FILEPUSH THREAD START");
// this is a race. FIXME.
@@ -66,6 +72,17 @@ void eFilePushThread::thread()
}
if (m_buf_end == 0)
{
+ /* on EOF, try COMMITting once. */
+ if (m_send_pvr_commit && !already_empty)
+ {
+ eDebug("sending PVR commit");
+ already_empty = 1;
+ if (::ioctl(m_fd_dest, PVR_COMMIT) == EINTR)
+ continue;
+ eDebug("commit done");
+ /* well check again */
+ continue;
+ }
sendEvent(evtEOF);
#if 0
@@ -77,7 +94,8 @@ void eFilePushThread::thread()
}
#endif
break;
- }
+ } else
+ already_empty = 0;
// printf("FILEPUSH: read %d bytes\n", m_buf_end);
}
@@ -119,6 +137,10 @@ void eFilePushThread::flush()
m_buf_start = m_buf_end = 0;
}
+void eFilePushThread::enablePVRCommit(int s)
+{
+ m_send_pvr_commit = s;
+}
void eFilePushThread::sendEvent(int evt)
{