aboutsummaryrefslogtreecommitdiff
path: root/lib/base
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base')
-rw-r--r--lib/base/buffer.cpp5
-rw-r--r--lib/base/eerror.cpp7
-rw-r--r--lib/base/encoding.cpp1
-rw-r--r--lib/base/estring.cpp14
-rw-r--r--lib/base/estring.h1
-rw-r--r--lib/base/filepush.cpp8
6 files changed, 27 insertions, 9 deletions
diff --git a/lib/base/buffer.cpp b/lib/base/buffer.cpp
index 3a0a6a3d..5dfdfad5 100644
--- a/lib/base/buffer.cpp
+++ b/lib/base/buffer.cpp
@@ -1,8 +1,9 @@
#include <lib/base/buffer.h>
#include <lib/base/eerror.h>
-#include <stdio.h>
+#include <cerrno>
+#include <cstdio>
+#include <cstring>
#include <unistd.h>
-#include <errno.h>
void eIOBuffer::removeblock()
{
diff --git a/lib/base/eerror.cpp b/lib/base/eerror.cpp
index 4c4d6551..35e46e05 100644
--- a/lib/base/eerror.cpp
+++ b/lib/base/eerror.cpp
@@ -1,8 +1,9 @@
#include <lib/base/eerror.h>
#include <lib/base/elock.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <unistd.h>
#include <string>
diff --git a/lib/base/encoding.cpp b/lib/base/encoding.cpp
index 5d6617d9..45fea102 100644
--- a/lib/base/encoding.cpp
+++ b/lib/base/encoding.cpp
@@ -1,3 +1,4 @@
+#include <cstdlib>
#include <lib/base/encoding.h>
#include <lib/base/eerror.h>
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp
index 5d15ddce..dcba7705 100644
--- a/lib/base/estring.cpp
+++ b/lib/base/estring.cpp
@@ -1,6 +1,7 @@
+#include <algorithm>
+#include <cctype>
+#include <climits>
#include <string>
-#include <ctype.h>
-#include <limits.h>
#include <lib/base/eerror.h>
#include <lib/base/encoding.h>
#include <lib/base/estring.h>
@@ -633,3 +634,12 @@ void makeUpper(std::string &s)
{
std::transform(s.begin(), s.end(), s.begin(), (int(*)(int)) toupper);
}
+
+std::string replace_all(const std::string &in, const std::string &entity, const std::string &symbol)
+{
+ std::string out = in;
+ std::string::size_type loc = 0;
+ while (( loc = out.find(entity, loc)) != std::string::npos )
+ out.replace(loc, entity.length(), symbol);
+ return out;
+}
diff --git a/lib/base/estring.h b/lib/base/estring.h
index 68e0970f..d61489eb 100644
--- a/lib/base/estring.h
+++ b/lib/base/estring.h
@@ -18,6 +18,7 @@ int isUTF8(const std::string &string);
std::string removeDVBChars(const std::string &s);
void makeUpper(std::string &s);
+std::string replace_all(const std::string &in, const std::string &entity, const std::string &symbol);
inline std::string convertDVBUTF8(const std::string &string, int table=0, int tsidonid=0) // with default ISO8859-1/Latin1
{
diff --git a/lib/base/filepush.cpp b/lib/base/filepush.cpp
index e99e956c..b81aec5c 100644
--- a/lib/base/filepush.cpp
+++ b/lib/base/filepush.cpp
@@ -189,9 +189,13 @@ void eFilePushThread::thread()
if (m_send_pvr_commit && !already_empty)
{
eDebug("sending PVR commit");
+
+ struct pollfd pfd[1] = {m_fd_dest, POLLHUP};
+ poll(pfd, 1, 10000);
+ sleep(5); /* HACK to allow ES buffer to drain */
already_empty = 1;
- if (::ioctl(m_fd_dest, PVR_COMMIT) < 0 && errno == EINTR)
- continue;
+// if (::ioctl(m_fd_dest, PVR_COMMIT) < 0 && errno == EINTR)
+// continue;
eDebug("commit done");
/* well check again */
continue;