summaryrefslogtreecommitdiff
path: root/xine_input_vdr.c
diff options
context:
space:
mode:
authorphintuka <phintuka>2007-03-08 13:24:35 +0000
committerphintuka <phintuka>2007-03-08 13:24:35 +0000
commitd38d94d2b68a69deb5e7d9c5afdb70b15fc345fc (patch)
tree5f78cf1016193211f3c221368826124928b83d5e /xine_input_vdr.c
parente76bea8bf36774645e73a448c23c48b55feaf7ca (diff)
downloadxineliboutput-d38d94d2b68a69deb5e7d9c5afdb70b15fc345fc.tar.gz
xineliboutput-d38d94d2b68a69deb5e7d9c5afdb70b15fc345fc.tar.bz2
Mac OS X compability fixes (patch by Tero Siironen)
Diffstat (limited to 'xine_input_vdr.c')
-rw-r--r--xine_input_vdr.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index abe08a9b..9e894bd2 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.75 2007-03-08 12:52:26 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.76 2007-03-08 13:24:35 phintuka Exp $
*
*/
@@ -31,16 +31,17 @@
#include <errno.h>
#include <sys/time.h>
#include <dlfcn.h>
-#include <linux/unistd.h> /* gettid() */
#include <sys/resource.h> /* setpriority() */
+#include <sys/stat.h>
#include <syslog.h>
-#define DVD_STREAMING_SPEED
+#ifndef __APPLE__
+# define DVD_STREAMING_SPEED
+#endif
#ifdef DVD_STREAMING_SPEED
-#include <linux/cdrom.h>
-#include <scsi/sg.h>
-#include <sys/stat.h>
+# include <linux/cdrom.h>
+# include <scsi/sg.h>
#endif
#include <xine/xine_internal.h>
@@ -119,11 +120,19 @@ static void syslog_with_tid(int level, const char *fmt, ...)
char buf[512];
va_start(argp, fmt);
vsnprintf(buf, sizeof(buf), fmt, argp);
+#ifdef __APPLE__
+ if(!bLogToSysLog) {
+ fprintf(stderr, LOG_MODULENAME "%s\n", buf);
+ } else {
+ syslog(level, LOG_MODULENAME "%s", buf);
+ }
+#else
if(!bLogToSysLog) {
fprintf(stderr,"[%ld] " LOG_MODULENAME "%s\n", syscall(__NR_gettid), buf);
} else {
syslog(level, "[%ld] " LOG_MODULENAME "%s", syscall(__NR_gettid), buf);
}
+#endif
va_end(argp);
}
@@ -879,8 +888,10 @@ static void scr_tunning_set_paused(vdr_input_plugin_t *this,
/******************************* TOOLS ***********************************/
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#define MAX(a,b) ((a)>(b)?(a):(b))
+#ifndef __APPLE__
+# define MIN(a,b) ((a)<(b)?(a):(b))
+# define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
static int64_t pts_from_pes(const uint8_t *buf, int size)
{
@@ -3141,7 +3152,11 @@ static int vdr_plugin_poll(vdr_input_plugin_t *this, int timeout_ms)
data source has higher priority than control source */
if(result <= 0) {
result = 0;
+#ifdef __APPLE__
+ sched_yield();
+#else
pthread_yield();
+#endif
xine_usec_sleep(3*1000);
}