[MPlayer-dev-eng] [PATCH] OpenBSD cvidix support

Ian Lindsay iml04 at hampshire.edu
Mon Jan 17 17:01:28 CET 2005


This time with just the relevant diff..
-------------- next part --------------
Index: libdha/libdha.c
===================================================================
RCS file: /cvsroot/mplayer/main/libdha/libdha.c,v
retrieving revision 1.12
diff -u -r1.12 libdha.c
--- libdha/libdha.c	26 Mar 2004 12:15:54 -0000	1.12
+++ libdha/libdha.c	17 Jan 2005 16:00:17 -0000
@@ -50,6 +50,10 @@
 #  endif
 # endif /* SVR4 */
 
+#if defined(__OpenBSD__)
+#define DEV_APERTURE "/dev/xf86"
+#endif
+
 /* Generic version */
 #include <sys/mman.h>
 
@@ -117,6 +121,24 @@
 #endif
 
 dev_mem_way:
+  if (mem_fd != -1)
+	goto mmap;
+
+#ifdef DEV_APERTURE
+  if ((mem_fd = open(DEV_APERTURE, O_RDWR)) == -1)
+	perror("libdha: opening aperture failed");
+  else {
+	void *p = mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,mem_fd,base);
+
+	if (p == MAP_FAILED) {
+	    perror("libdha: mapping aperture failed");
+	    close(mem_fd);
+	    mem_fd = -1;
+	} else
+	    return p;
+  }
+#endif
+
   if ( (mem_fd = open(DEV_MEM,O_RDWR)) == -1)
   {
     perror("libdha: opening /dev/mem failed");


More information about the MPlayer-dev-eng mailing list