update to v 0.9.5, lots of error condition fixes, better types.

This commit is contained in:
espie 2006-02-16 11:08:26 +00:00
parent 86733aad6b
commit df4c6c8786
4 changed files with 96 additions and 63 deletions

View File

@ -1,11 +1,10 @@
#$OpenBSD: Makefile,v 1.11 2006/01/03 14:55:18 bernd Exp $
#$OpenBSD: Makefile,v 1.12 2006/02/16 11:08:26 espie Exp $
CATEGORIES= devel
COMMENT= "accessing DVD files"
DISTNAME= libdvdread-0.9.4
PKGNAME= ${DISTNAME}p2
SHARED_LIBS= dvdread 3.0
MODGNU_SHARED_LIBS= dvdread '-export-symbols-regex "(DVD.*|ifo.*|nav.*)"'
DISTNAME= libdvdread-0.9.5
PKGNAME= ${DISTNAME}
SHARED_LIBS= dvdread 4.0
HOMEPAGE= http://www.dtek.chalmers.se/groups/dvd/
MASTER_SITES= ${HOMEPAGE}dist/

View File

@ -1,4 +1,4 @@
MD5 (libdvdread-0.9.4.tar.gz) = 06353d7b14541ff8b431e69ad404db84
RMD160 (libdvdread-0.9.4.tar.gz) = 9f7f82e14fb5d458686e5cb2e5f364bad19dd08e
SHA1 (libdvdread-0.9.4.tar.gz) = a4b626e49ba8bd33857693c3abe8b34196bc3360
SIZE (libdvdread-0.9.4.tar.gz) = 256858
MD5 (libdvdread-0.9.5.tar.gz) = baa9a07a8da5ed9db6a9a3ed1ad4478c
RMD160 (libdvdread-0.9.5.tar.gz) = a558dad42487fb39771c89862075bc29c2d054ca
SHA1 (libdvdread-0.9.5.tar.gz) = 7f10287953edb6f00667e12fee3a8b101be9f1cd
SIZE (libdvdread-0.9.5.tar.gz) = 381006

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
--- dvdread/dvd_input.c.orig Thu Feb 13 16:48:24 2003
+++ dvdread/dvd_input.c Thu Nov 3 15:03:34 2005
@@ -36,30 +36,30 @@ int (*dvdinput_read) (dvd_input
$OpenBSD: patch-dvdread_dvd_input_c,v 1.5 2006/02/16 11:08:26 espie Exp $
--- dvdread/dvd_input.c.orig Mon Sep 19 15:43:08 2005
+++ dvdread/dvd_input.c Thu Feb 16 12:01:14 2006
@@ -45,30 +45,30 @@ int (*dvdinput_read) (dvd_input
char * (*dvdinput_error) (dvd_input_t);
#ifdef HAVE_DVDCSS_DVDCSS_H
@ -34,7 +34,7 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
-static char * (*DVDcss_error) (dvdcss_handle);
+typedef struct libdvd_s *libdvd_handle;
+static libdvd_handle (*DVD_open) (const char *);
+static int (*DVD_close) (libdvs_handle);
+static int (*DVD_close) (libdvd_handle);
+static int (*DVD_seek) (libdvd_handle, int, int);
+static int (*DVD_title) (libdvd_handle, int);
+static int (*DVD_read) (libdvd_handle, void *, int, int);
@ -50,7 +50,7 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
/* dummy file input */
int fd;
@@ -69,7 +69,7 @@ struct dvd_input_s {
@@ -78,7 +78,7 @@ struct dvd_input_s {
/**
* initialize and open a DVD device or file.
*/
@ -59,22 +59,20 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
{
dvd_input_t dev;
@@ -80,10 +80,10 @@ static dvd_input_t css_open(const char *
@@ -89,9 +89,9 @@ static dvd_input_t css_open(const char *
return NULL;
}
- /* Really open it with libdvdcss */
- dev->dvdcss = DVDcss_open(target);
- if(dev->dvdcss == 0) {
- fprintf(stderr, "libdvdread: Could not open %s with libdvdcss.\n", target);
+ /* Really open it with dvdcss */
+ dev->libdvd = DVD_open(target);
+ if(dev->libdvd == 0) {
+ fprintf(stderr, "libdvdread: Could not open %s with libdvd.\n", target);
free(dev);
return NULL;
dev = NULL;
}
@@ -94,44 +94,44 @@ static dvd_input_t css_open(const char *
@@ -102,44 +102,44 @@ static dvd_input_t css_open(const char *
/**
* return the last error message
*/
@ -129,7 +127,33 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
if(ret < 0)
return ret;
@@ -259,83 +259,83 @@ static int file_close(dvd_input_t dev)
@@ -280,8 +280,8 @@ static int file_close(dvd_input_t dev)
}
-static void *dvdcss_library = NULL;
-static int dvdcss_library_init = 0;
+static void *libdvd_library = NULL;
+static int libdvd_library_init = 0;
/**
* Free any objects allocated by dvdinput_setup.
@@ -294,28 +294,28 @@ void dvdinput_free(void)
/* linked statically, nothing to free */
return;
#else
- if(dvdcss_library) {
- dlclose(dvdcss_library);
- dvdcss_library = NULL;
+ if(libdvd_library) {
+ dlclose(libdvd_library);
+ libdvd_library = NULL;
}
- dvdcss_library_init = 0;
+ libdvd_library_init = 0;
return;
#endif
}
/**
@ -138,27 +162,34 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
*/
int dvdinput_setup(void)
{
- void *dvdcss_library = NULL;
- char **dvdcss_version = NULL;
+ void *libdvd_library = NULL;
+ char **libdvd_version = NULL;
int verbose;
/* dlopening libdvdcss */
- if(dvdcss_library_init) {
+ if(libdvd_library_init) {
/* libdvdcss is already dlopened, function ptrs set */
- if(dvdcss_library) {
+ if(libdvd_library) {
return 1; /* css available */
} else {
return 0; /* css not available */
@@ -326,59 +326,57 @@ int dvdinput_setup(void)
#ifdef HAVE_DVDCSS_DVDCSS_H
- /* linking to libdvdcss */
/* linking to libdvdcss */
- dvdcss_library = &dvdcss_library; /* Give it some value != NULL */
- /* the DVDcss_* functions have been #defined at the top */
- dvdcss_version = &dvdcss_interface_2;
+ /* linking to dvdcss */
+ libdvd_library = &libdvd_library; /* Give it some value != NULL */
+ /* the DVD_* functions have been #defined at the top */
/* the DVDcss_* functions have been #defined at the top */
- dvdcss_version = &dvdcss_interface_2;
+ libdvd_version = &libdvd_interface_2;
#else
- /* dlopening libdvdcss */
- dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
+ /* dlopening dvdcss */
+ libdvd_library = dlopen("libdvd.so.0", RTLD_LAZY);
- if(dvdcss_library != NULL) {
+ if(libdvd_library != NULL) {
#if defined(__OpenBSD__) && !defined(__ELF__)
@ -195,50 +226,59 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
+ libdvd_version = (char **)dlsym(libdvd_library, U_S "libdvd_interface_2");
- if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
+ if(dlsym(libdvd_library, U_S "libdvd_crack")) {
fprintf(stderr,
- "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
+ "libdvdread: Old (pre-0.0.2) version of libdvd found.\n"
"libdvdread: You should get the latest version from "
"http://www.videolan.org/\n" );
+ if(dlsym(libdvd_library, U_S "dvdcss_crack")) {
if(verbose >= 0) {
fprintf(stderr,
- "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
- "libdvdread: You should get the latest version from "
- "http://www.videolan.org/\n" );
+ "libdvdread: Old (pre-0.0.2) version of libdvd found.\n");
}
- dlclose(dvdcss_library);
- 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, "
- || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
+ dlclose(libdvd_library);
+ libdvd_library = NULL;
+ } else if(!DVD_open || !DVD_close || !DVD_title || !DVD_seek
+ || !DVD_read || !DVD_error || !libdvd_version) {
+ fprintf(stderr, "libdvdread: Missing symbols in libdvd.so.0, "
"this shouldn't happen !\n");
+ || !DVD_read || !DVD_error || !libdvd_version) {
if(verbose >= 0) {
- fprintf(stderr, "libdvdread: Missing symbols in libdvdcss.so.2, "
+ fprintf(stderr, "libdvdread: Missing symbols in libdvd.so.0, "
"this shouldn't happen !\n");
}
- dlclose(dvdcss_library);
- dvdcss_library = NULL;
+ dlclose(libdvd_library);
+ libdvd_library = NULL;
}
}
#endif /* HAVE_DVDCSS_DVDCSS_H */
- dvdcss_library_init = 1;
+ libdvd_library_init = 1;
- if(dvdcss_library != NULL) {
+ if(libdvd_library != NULL) {
- if(dvdcss_library) {
+ if(libdvd_library) {
/*
char *psz_method = getenv( "DVDCSS_METHOD" );
char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method);
fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
char *psz_method = getenv( "DVDCSS_METHOD" );
char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
@@ -386,16 +384,16 @@ int dvdinput_setup(void)
fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
*/
- fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
- *dvdcss_version);
+ fprintf(stderr, "libdvdread: Using libdvd version %s for DVD access\n",
+ *libdvd_version);
- /* libdvdcss wrapper functions */
if(verbose >= 1) {
- fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
- *dvdcss_version);
+ fprintf(stderr, "libdvdread: Using libdvd version %s for DVD access\n",
+ *libdvd_version);
}
/* libdvdcss wrapper functions */
- dvdinput_open = css_open;
- dvdinput_close = css_close;
- dvdinput_seek = css_seek;
- dvdinput_title = css_title;
- dvdinput_read = css_read;
- dvdinput_error = css_error;
+ /* dvdcss wrapper functions */
+ dvdinput_open = libdvd_open;
+ dvdinput_close = libdvd_close;
+ dvdinput_seek = libdvd_seek;
@ -248,10 +288,3 @@ $OpenBSD: patch-dvdread_dvd_input_c,v 1.4 2005/11/03 22:29:48 kurt Exp $
return 1;
} else {
fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");
- /* libdvdcss replacement functions */
+ /* dvdcss replacement functions */
dvdinput_open = file_open;
dvdinput_close = file_close;
dvdinput_seek = file_seek;

View File

@ -1,5 +1,6 @@
@comment $OpenBSD: PLIST,v 1.4 2004/08/10 00:52:44 espie Exp $
@comment $OpenBSD: PLIST,v 1.5 2006/02/16 11:08:26 espie Exp $
include/dvdread/
include/dvdread/cmd_print.h
include/dvdread/dvd_reader.h
include/dvdread/ifo_print.h
include/dvdread/ifo_read.h