Commit 9da70ef6 authored by Christophe Massiot's avatar Christophe Massiot

* ALL: Do no longer assume a default DVD drive. If no DVD drive is

   specified (an empty string), forward the empty string to libdvdcss
   and let it do autodetection.
 * extras/contrib/src/Patches: Patched libdvdread to accept an empty
   string as a device path.
parent 167bb4dc
diff -ru libdvdnav-orig/configure.ac libdvdnav/configure.ac diff -ru libdvdnav-0.1.10/configure.ac libdvdnav/configure.ac
--- libdvdnav-orig/configure.ac Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/configure.ac 2004-06-10 23:13:02.000000000 +0200
+++ libdvdnav/configure.ac Sat Mar 12 16:44:26 2005 +++ libdvdnav/configure.ac 2005-08-31 19:56:21.000000000 +0200
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
dnl -------------------------------------------------------------- dnl --------------------------------------------------------------
dnl Require autoconf version 2.53 dnl Require autoconf version 2.53
...@@ -110,9 +110,9 @@ diff -ru libdvdnav-orig/configure.ac libdvdnav/configure.ac ...@@ -110,9 +110,9 @@ diff -ru libdvdnav-orig/configure.ac libdvdnav/configure.ac
dnl --------------------------------------------- dnl ---------------------------------------------
dnl cflags dnl cflags
diff -ru libdvdnav-orig/examples/Makefile.am libdvdnav/examples/Makefile.am diff -ru libdvdnav-0.1.10/examples/Makefile.am libdvdnav/examples/Makefile.am
--- libdvdnav-orig/examples/Makefile.am Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/examples/Makefile.am 2004-01-11 22:43:12.000000000 +0100
+++ libdvdnav/examples/Makefile.am Sat Mar 12 16:44:26 2005 +++ libdvdnav/examples/Makefile.am 2005-08-31 19:56:21.000000000 +0200
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
noinst_PROGRAMS = menus noinst_PROGRAMS = menus
...@@ -122,9 +122,9 @@ diff -ru libdvdnav-orig/examples/Makefile.am libdvdnav/examples/Makefile.am ...@@ -122,9 +122,9 @@ diff -ru libdvdnav-orig/examples/Makefile.am libdvdnav/examples/Makefile.am
menus_LDADD = $(DVDNAV_LIB) menus_LDADD = $(DVDNAV_LIB)
$(DVDNAV_LIB): $(DVDNAV_LIB):
diff -ru libdvdnav-orig/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h diff -ru libdvdnav-0.1.10/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h
--- libdvdnav-orig/src/dvdnav_internal.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdnav_internal.h 2004-02-13 20:16:17.000000000 +0100
+++ libdvdnav/src/dvdnav_internal.h Sat Mar 12 16:44:26 2005 +++ libdvdnav/src/dvdnav_internal.h 2005-08-31 19:56:21.000000000 +0200
@@ -58,6 +58,15 @@ @@ -58,6 +58,15 @@
#include <io.h> /* read() */ #include <io.h> /* read() */
#define lseek64 _lseeki64 #define lseek64 _lseeki64
...@@ -141,9 +141,9 @@ diff -ru libdvdnav-orig/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h ...@@ -141,9 +141,9 @@ diff -ru libdvdnav-orig/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h
#else #else
#include <pthread.h> #include <pthread.h>
diff -ru libdvdnav-orig/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h diff -ru libdvdnav-0.1.10/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h
--- libdvdnav-orig/src/dvdread/bswap.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/bswap.h 2004-01-11 22:43:13.000000000 +0100
+++ libdvdnav/src/dvdread/bswap.h Sat Mar 12 16:44:26 2005 +++ libdvdnav/src/dvdread/bswap.h 2005-08-31 19:56:21.000000000 +0200
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
* functionality! * functionality!
*/ */
...@@ -153,9 +153,9 @@ diff -ru libdvdnav-orig/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h ...@@ -153,9 +153,9 @@ diff -ru libdvdnav-orig/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h
#define B2N_16(x) \ #define B2N_16(x) \
x = ((((x) & 0xff00) >> 8) | \ x = ((((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8)) (((x) & 0x00ff) << 8))
diff -ru libdvdnav-orig/src/dvdread/dvd_input.h libdvdnav/src/dvdread/dvd_input.h diff -ru libdvdnav-0.1.10/src/dvdread/dvd_input.h libdvdnav/src/dvdread/dvd_input.h
--- libdvdnav-orig/src/dvdread/dvd_input.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/dvd_input.h 2004-01-11 22:43:13.000000000 +0100
+++ libdvdnav/src/dvdread/dvd_input.h Sat Mar 12 17:36:26 2005 +++ libdvdnav/src/dvdread/dvd_input.h 2005-08-31 19:56:21.000000000 +0200
@@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/ */
...@@ -165,10 +165,30 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_input.h libdvdnav/src/dvdread/dvd_input. ...@@ -165,10 +165,30 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_input.h libdvdnav/src/dvdread/dvd_input.
/** /**
* Defines and flags. Make sure they fit the libdvdcss API! * Defines and flags. Make sure they fit the libdvdcss API!
*/ */
diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reader.c diff -ru libdvdnav-0.1.10/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reader.c
--- libdvdnav-orig/src/dvdread/dvd_reader.c Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/dvd_reader.c 2004-03-03 17:48:36.000000000 +0100
+++ libdvdnav/src/dvdread/dvd_reader.c Sat Mar 12 17:34:48 2005 +++ libdvdnav/src/dvdread/dvd_reader.c 2005-08-31 19:58:34.000000000 +0200
@@ -403,14 +403,16 @@ @@ -346,9 +346,7 @@
}
#endif
- ret = stat( path, &fileinfo );
-
- if( ret < 0 ) {
+ if( *path && (ret = stat( path, &fileinfo )) < 0 ) {
/* maybe "host:port" url? try opening it with acCeSS library */
if( strchr(path,':') ) {
@@ -365,7 +363,7 @@
}
/* First check if this is a block/char device or a file*/
- if( S_ISBLK( fileinfo.st_mode ) ||
+ if( !*path || S_ISBLK( fileinfo.st_mode ) ||
S_ISCHR( fileinfo.st_mode ) ||
S_ISREG( fileinfo.st_mode ) ) {
@@ -403,14 +401,16 @@
/* Resolve any symlinks and get the absolut dir name. */ /* Resolve any symlinks and get the absolut dir name. */
{ {
...@@ -189,7 +209,7 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reade ...@@ -189,7 +209,7 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reade
if( new_path ) { if( new_path ) {
free( path_copy ); free( path_copy );
path_copy = new_path; path_copy = new_path;
@@ -585,10 +587,12 @@ @@ -585,10 +585,12 @@
sprintf( filename, "%s%s%s", path, sprintf( filename, "%s%s%s", path,
( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ), ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
ent->d_name ); ent->d_name );
...@@ -202,9 +222,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reade ...@@ -202,9 +222,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reade
return -1; return -1;
} }
diff -ru libdvdnav-orig/src/dvdread/dvd_reader.h libdvdnav/src/dvdread/dvd_reader.h diff -ru libdvdnav-0.1.10/src/dvdread/dvd_reader.h libdvdnav/src/dvdread/dvd_reader.h
--- libdvdnav-orig/src/dvdread/dvd_reader.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/dvd_reader.h 2004-02-01 18:55:19.000000000 +0100
+++ libdvdnav/src/dvdread/dvd_reader.h Sat Mar 12 17:43:28 2005 +++ libdvdnav/src/dvdread/dvd_reader.h 2005-08-31 19:56:21.000000000 +0200
@@ -21,6 +21,20 @@ @@ -21,6 +21,20 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -226,9 +246,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.h libdvdnav/src/dvdread/dvd_reade ...@@ -226,9 +246,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.h libdvdnav/src/dvdread/dvd_reade
#ifdef _MSC_VER #ifdef _MSC_VER
#include <config.h> #include <config.h>
diff -ru libdvdnav-orig/src/dvdread/dvd_udf.h libdvdnav/src/dvdread/dvd_udf.h diff -ru libdvdnav-0.1.10/src/dvdread/dvd_udf.h libdvdnav/src/dvdread/dvd_udf.h
--- libdvdnav-orig/src/dvdread/dvd_udf.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/dvd_udf.h 2004-01-11 22:43:13.000000000 +0100
+++ libdvdnav/src/dvdread/dvd_udf.h Sat Mar 12 17:44:45 2005 +++ libdvdnav/src/dvdread/dvd_udf.h 2005-08-31 19:56:21.000000000 +0200
@@ -31,6 +31,13 @@ @@ -31,6 +31,13 @@
* http://www.gnu.org/copyleft/gpl.html * http://www.gnu.org/copyleft/gpl.html
*/ */
...@@ -243,9 +263,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_udf.h libdvdnav/src/dvdread/dvd_udf.h ...@@ -243,9 +263,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_udf.h libdvdnav/src/dvdread/dvd_udf.h
#include <inttypes.h> #include <inttypes.h>
#include "dvd_reader.h" #include "dvd_reader.h"
diff -ru libdvdnav-orig/src/dvdread/ifo_print.h libdvdnav/src/dvdread/ifo_print.h diff -ru libdvdnav-0.1.10/src/dvdread/ifo_print.h libdvdnav/src/dvdread/ifo_print.h
--- libdvdnav-orig/src/dvdread/ifo_print.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/ifo_print.h 2004-01-11 22:43:13.000000000 +0100
+++ libdvdnav/src/dvdread/ifo_print.h Sat Mar 12 17:46:07 2005 +++ libdvdnav/src/dvdread/ifo_print.h 2005-08-31 19:56:21.000000000 +0200
@@ -20,6 +20,21 @@ @@ -20,6 +20,21 @@
#ifndef IFO_PRINT_H_INCLUDED #ifndef IFO_PRINT_H_INCLUDED
#define IFO_PRINT_H_INCLUDED #define IFO_PRINT_H_INCLUDED
...@@ -268,9 +288,9 @@ diff -ru libdvdnav-orig/src/dvdread/ifo_print.h libdvdnav/src/dvdread/ifo_print. ...@@ -268,9 +288,9 @@ diff -ru libdvdnav-orig/src/dvdread/ifo_print.h libdvdnav/src/dvdread/ifo_print.
#include <inttypes.h> #include <inttypes.h>
#ifdef DVDNAV_COMPILE #ifdef DVDNAV_COMPILE
# include "ifo_types.h" # include "ifo_types.h"
diff -ru libdvdnav-orig/src/dvdread/ifo_read.h libdvdnav/src/dvdread/ifo_read.h diff -ru libdvdnav-0.1.10/src/dvdread/ifo_read.h libdvdnav/src/dvdread/ifo_read.h
--- libdvdnav-orig/src/dvdread/ifo_read.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/ifo_read.h 2004-01-11 22:43:13.000000000 +0100
+++ libdvdnav/src/dvdread/ifo_read.h Sat Mar 12 17:48:22 2005 +++ libdvdnav/src/dvdread/ifo_read.h 2005-08-31 19:56:21.000000000 +0200
@@ -20,6 +20,37 @@ @@ -20,6 +20,37 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
...@@ -309,9 +329,9 @@ diff -ru libdvdnav-orig/src/dvdread/ifo_read.h libdvdnav/src/dvdread/ifo_read.h ...@@ -309,9 +329,9 @@ diff -ru libdvdnav-orig/src/dvdread/ifo_read.h libdvdnav/src/dvdread/ifo_read.h
#include "ifo_types.h" #include "ifo_types.h"
#include "dvd_reader.h" #include "dvd_reader.h"
diff -ru libdvdnav-orig/src/dvdread/md5.h libdvdnav/src/dvdread/md5.h diff -ru libdvdnav-0.1.10/src/dvdread/md5.h libdvdnav/src/dvdread/md5.h
--- libdvdnav-orig/src/dvdread/md5.h Sat Mar 12 16:44:18 2005 --- libdvdnav-0.1.10/src/dvdread/md5.h 2004-01-11 22:43:13.000000000 +0100
+++ libdvdnav/src/dvdread/md5.h Sat Mar 12 17:49:33 2005 +++ libdvdnav/src/dvdread/md5.h 2005-08-31 19:56:21.000000000 +0200
@@ -21,6 +21,14 @@ @@ -21,6 +21,14 @@
#ifndef _MD5_H #ifndef _MD5_H
#define _MD5_H 1 #define _MD5_H 1
......
diff -ru libdvdread-orig/dvdread/bswap.h libdvdread/dvdread/bswap.h Only in libdvdread/dvdread: .dvd_input.c.swp
--- libdvdread-orig/dvdread/bswap.h Sat Mar 12 16:42:18 2005 diff -ru libdvdread-0.9.4/dvdread/bswap.h libdvdread/dvdread/bswap.h
+++ libdvdread/dvdread/bswap.h Sat Mar 12 16:42:25 2005 --- libdvdread-0.9.4/dvdread/bswap.h 2002-12-15 01:09:12.000000000 +0100
+++ libdvdread/dvdread/bswap.h 2005-08-31 19:24:57.000000000 +0200
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
* functionality! * functionality!
*/ */
...@@ -10,10 +11,29 @@ diff -ru libdvdread-orig/dvdread/bswap.h libdvdread/dvdread/bswap.h ...@@ -10,10 +11,29 @@ diff -ru libdvdread-orig/dvdread/bswap.h libdvdread/dvdread/bswap.h
#define B2N_16(x) \ #define B2N_16(x) \
x = ((((x) & 0xff00) >> 8) | \ x = ((((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8)) (((x) & 0x00ff) << 8))
diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c diff -ru libdvdread-0.9.4/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
--- libdvdread-orig/dvdread/dvd_reader.c Sat Mar 12 16:42:18 2005 --- libdvdread-0.9.4/dvdread/dvd_reader.c 2003-02-13 23:31:21.000000000 +0100
+++ libdvdread/dvdread/dvd_reader.c Sat Mar 12 16:48:29 2005 +++ libdvdread/dvdread/dvd_reader.c 2005-08-31 19:24:57.000000000 +0200
@@ -344,14 +344,16 @@ @@ -303,8 +303,7 @@
if( path == NULL )
return 0;
- ret = stat( path, &fileinfo );
- if( ret < 0 ) {
+ if( *path && (ret = stat( path, &fileinfo ) < 0) ) {
/* If we can't stat the file, give up */
fprintf( stderr, "libdvdread: Can't stat %s\n", path );
perror("");
@@ -315,7 +314,7 @@
have_css = dvdinput_setup();
/* First check if this is a block/char device or a file*/
- if( S_ISBLK( fileinfo.st_mode ) ||
+ if( !*path || S_ISBLK( fileinfo.st_mode ) ||
S_ISCHR( fileinfo.st_mode ) ||
S_ISREG( fileinfo.st_mode ) ) {
@@ -344,14 +343,16 @@
/* Resolve any symlinks and get the absolut dir name. */ /* Resolve any symlinks and get the absolut dir name. */
{ {
...@@ -35,7 +55,7 @@ diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c ...@@ -35,7 +55,7 @@ diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
if( new_path ) { if( new_path ) {
free( path_copy ); free( path_copy );
path_copy = new_path; path_copy = new_path;
@@ -504,10 +506,12 @@ @@ -504,10 +505,12 @@
sprintf( filename, "%s%s%s", path, sprintf( filename, "%s%s%s", path,
( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ), ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
ent->d_name ); ent->d_name );
...@@ -48,3 +68,4 @@ diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c ...@@ -48,3 +68,4 @@ diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
return -1; return -1;
} }
Only in libdvdread/dvdread: dvd_reader.c.orig
...@@ -92,11 +92,9 @@ ...@@ -92,11 +92,9 @@
/* DVD and VCD devices */ /* DVD and VCD devices */
#if !defined( WIN32 ) && !defined( UNDER_CE ) #if !defined( WIN32 ) && !defined( UNDER_CE )
# define DVD_DEVICE "/dev/dvd"
# define VCD_DEVICE "/dev/cdrom" # define VCD_DEVICE "/dev/cdrom"
# define CDAUDIO_DEVICE "/dev/cdrom" # define CDAUDIO_DEVICE "/dev/cdrom"
#else #else
# define DVD_DEVICE "D:"
# define VCD_DEVICE "D:" # define VCD_DEVICE "D:"
# define CDAUDIO_DEVICE "D:" # define CDAUDIO_DEVICE "D:"
#endif #endif
......
...@@ -176,13 +176,13 @@ static int Open( vlc_object_t *p_this ) ...@@ -176,13 +176,13 @@ static int Open( vlc_object_t *p_this )
if( !p_this->b_force ) return VLC_EGENERIC; if( !p_this->b_force ) return VLC_EGENERIC;
psz_name = var_CreateGetString( p_this, "dvd" ); psz_name = var_CreateGetString( p_this, "dvd" );
if( !psz_name || !*psz_name ) if( !psz_name )
{ {
if( psz_name ) free( psz_name ); psz_name = strdup("");
return VLC_EGENERIC;
} }
} }
else psz_name = strdup( p_demux->psz_path ); else
psz_name = strdup( p_demux->psz_path );
#ifdef WIN32 #ifdef WIN32
if( psz_name[0] && psz_name[1] == ':' && if( psz_name[0] && psz_name[1] == ':' &&
......
...@@ -192,13 +192,13 @@ static int Open( vlc_object_t *p_this ) ...@@ -192,13 +192,13 @@ static int Open( vlc_object_t *p_this )
if( !p_this->b_force ) return VLC_EGENERIC; if( !p_this->b_force ) return VLC_EGENERIC;
psz_name = var_CreateGetString( p_this, "dvd" ); psz_name = var_CreateGetString( p_this, "dvd" );
if( !psz_name || !*psz_name ) if( !psz_name )
{ {
if( psz_name ) free( psz_name ); psz_name = strdup("");
return VLC_EGENERIC;
} }
} }
else psz_name = strdup( p_demux->psz_path ); else
psz_name = strdup( p_demux->psz_path );
#ifdef WIN32 #ifdef WIN32
if( psz_name[0] && psz_name[1] == ':' && if( psz_name[0] && psz_name[1] == ':' &&
......
...@@ -1112,7 +1112,7 @@ vlc_module_begin(); ...@@ -1112,7 +1112,7 @@ vlc_module_begin();
set_section( N_( "Default devices") , NULL ) set_section( N_( "Default devices") , NULL )
add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, add_file( "dvd", NULL, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT,
VLC_FALSE ); VLC_FALSE );
add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT, add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT,
VLC_FALSE ); VLC_FALSE );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment