changeset 281:6853c398600c src

support for dvdcss in Darwin; patch by Diego Petteno' and Reimar
author nicodvb
date Wed, 18 Apr 2007 22:34:52 +0000
parents 056a92fbd053
children 918fe20358cb
files dvdread/dvd_input.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/dvdread/dvd_input.c	Tue Apr 17 21:02:51 2007 +0000
+++ b/dvdread/dvd_input.c	Wed Apr 18 22:34:52 2007 +0000
@@ -287,10 +287,15 @@
 #else
   /* dlopening libdvdcss */
 
-#ifndef WIN32
-  dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
+#ifdef __APPLE__
+  #define CSS_LIB "libdvdcss.2.dylib"
+  dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
+#elif defined(WIN32)
+  #define CSS_LIB "libdvdcss.dll"
+  dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
 #else
-  dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY);
+  #define CSS_LIB "libdvdcss.so.2"
+  dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
 #endif
 
   if(dvdcss_library != NULL) {
@@ -323,8 +328,8 @@
       dvdcss_library = NULL;
     } else if(!DVDcss_open  || !DVDcss_close || !DVDcss_title || !DVDcss_seek
 	      || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
-      fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss.so.2, "
-	      "this shouldn't happen !\n");
+      fprintf(stderr,  "libdvdread: Missing symbols in %s, "
+	      "this shouldn't happen !\n", CSS_LIB);
       dlclose(dvdcss_library);
     }
   }