summaryrefslogtreecommitdiff
path: root/src/input/libdvdnav/dvd_input.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-04-29 21:55:46 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-04-29 21:55:46 +0000
commitc226b5c184993b4dc09816e4da08a533b656f934 (patch)
tree548c51ffe6a46b5ee36aad927cd6fe9ded7b24fa /src/input/libdvdnav/dvd_input.c
parenta1684eb4fdb2a9d9812d994f3a39904b15267905 (diff)
downloadxine-lib-c226b5c184993b4dc09816e4da08a533b656f934.tar.gz
xine-lib-c226b5c184993b4dc09816e4da08a533b656f934.tar.bz2
Update from libdvdnav
CVS patchset: 4712 CVS date: 2003/04/29 21:55:46
Diffstat (limited to 'src/input/libdvdnav/dvd_input.c')
-rw-r--r--src/input/libdvdnav/dvd_input.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/input/libdvdnav/dvd_input.c b/src/input/libdvdnav/dvd_input.c
index decc5c42a..bad7097a2 100644
--- a/src/input/libdvdnav/dvd_input.c
+++ b/src/input/libdvdnav/dvd_input.c
@@ -24,9 +24,18 @@
#include <fcntl.h>
#include <unistd.h>
+#include <dlfcn.h>
+
#include "dvd_reader.h"
#include "dvd_input.h"
+
+#ifndef _MSC_VER
+#define LIBDVDCSS_NAME = "libdvdcss.so.2"
+#else
+#define LIBDVDCSS_NAME = "libdvdcss.dll"
+#endif
+
/* The function pointers that is the exported interface of this file. */
dvd_input_t (*dvdinput_open) (const char *);
int (*dvdinput_close) (dvd_input_t);
@@ -45,8 +54,10 @@ char * (*dvdinput_error) (dvd_input_t);
#define DVDcss_read dvdcss_read
#define DVDcss_error dvdcss_error
#else
+
/* dlopening libdvdcss */
#include <dlfcn.h>
+
typedef struct dvdcss_s *dvdcss_handle;
static dvdcss_handle (*DVDcss_open) (const char *);
static int (*DVDcss_close) (dvdcss_handle);
@@ -74,7 +85,7 @@ static dvd_input_t css_open(const char *target)
dvd_input_t dev;
/* Allocate the handle structure */
- dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
+ dev = (dvd_input_t) malloc(sizeof(*dev));
if(dev == NULL) {
fprintf(stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
@@ -154,7 +165,7 @@ static dvd_input_t file_open(const char *target)
dvd_input_t dev;
/* Allocate the library structure */
- dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
+ dev = (dvd_input_t) malloc(sizeof(*dev));
if(dev == NULL) {
fprintf(stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
@@ -274,8 +285,13 @@ int dvdinput_setup(void)
#else
/* dlopening libdvdcss */
+
+#ifndef _MSC_VER
dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
-
+#else
+ dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY);
+#endif
+
if(dvdcss_library != NULL) {
#if defined(__OpenBSD__) && !defined(__ELF__)
#define U_S "_"