]> git.sesse.net Git - vlc/commitdiff
* ALL: Do no longer assume a default DVD drive. If no DVD drive is
authorChristophe Massiot <massiot@videolan.org>
Wed, 31 Aug 2005 19:09:50 +0000 (19:09 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 31 Aug 2005 19:09:50 +0000 (19:09 +0000)
   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.

extras/contrib/src/Patches/dvdnav.patch
extras/contrib/src/Patches/libdvdread.patch
include/vlc_config.h
modules/access/dvdnav.c
modules/access/dvdread.c
src/libvlc.h

index 12cba04fe71c3cf9b4d270354aa0c20ba57f1141..5fd2991d4513f5149fd8ed463b10bd3899c7db31 100644 (file)
@@ -1,6 +1,6 @@
-diff -ru libdvdnav-orig/configure.ac libdvdnav/configure.ac
---- libdvdnav-orig/configure.ac        Sat Mar 12 16:44:18 2005
-+++ libdvdnav/configure.ac     Sat Mar 12 16:44:26 2005
+diff -ru libdvdnav-0.1.10/configure.ac libdvdnav/configure.ac
+--- libdvdnav-0.1.10/configure.ac      2004-06-10 23:13:02.000000000 +0200
++++ libdvdnav/configure.ac     2005-08-31 19:56:21.000000000 +0200
 @@ -8,7 +8,7 @@
  dnl --------------------------------------------------------------
  dnl Require autoconf version 2.53
@@ -110,9 +110,9 @@ diff -ru libdvdnav-orig/configure.ac libdvdnav/configure.ac
  
  dnl ---------------------------------------------
  dnl cflags
-diff -ru libdvdnav-orig/examples/Makefile.am libdvdnav/examples/Makefile.am
---- libdvdnav-orig/examples/Makefile.am        Sat Mar 12 16:44:18 2005
-+++ libdvdnav/examples/Makefile.am     Sat Mar 12 16:44:26 2005
+diff -ru libdvdnav-0.1.10/examples/Makefile.am libdvdnav/examples/Makefile.am
+--- libdvdnav-0.1.10/examples/Makefile.am      2004-01-11 22:43:12.000000000 +0100
++++ libdvdnav/examples/Makefile.am     2005-08-31 19:56:21.000000000 +0200
 @@ -7,7 +7,7 @@
  noinst_PROGRAMS = menus
  
@@ -122,9 +122,9 @@ diff -ru libdvdnav-orig/examples/Makefile.am libdvdnav/examples/Makefile.am
  menus_LDADD   = $(DVDNAV_LIB)
  
  $(DVDNAV_LIB):
-diff -ru libdvdnav-orig/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h
---- libdvdnav-orig/src/dvdnav_internal.h       Sat Mar 12 16:44:18 2005
-+++ libdvdnav/src/dvdnav_internal.h    Sat Mar 12 16:44:26 2005
+diff -ru libdvdnav-0.1.10/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h
+--- libdvdnav-0.1.10/src/dvdnav_internal.h     2004-02-13 20:16:17.000000000 +0100
++++ libdvdnav/src/dvdnav_internal.h    2005-08-31 19:56:21.000000000 +0200
 @@ -58,6 +58,15 @@
  #include <io.h> /* read() */
  #define lseek64 _lseeki64
@@ -141,9 +141,9 @@ diff -ru libdvdnav-orig/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h
  #else
  
  #include <pthread.h>
-diff -ru libdvdnav-orig/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h
---- libdvdnav-orig/src/dvdread/bswap.h Sat Mar 12 16:44:18 2005
-+++ libdvdnav/src/dvdread/bswap.h      Sat Mar 12 16:44:26 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h
+--- libdvdnav-0.1.10/src/dvdread/bswap.h       2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav/src/dvdread/bswap.h      2005-08-31 19:56:21.000000000 +0200
 @@ -65,7 +65,7 @@
   * functionality! 
   */
@@ -153,9 +153,9 @@ diff -ru libdvdnav-orig/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h
  #define B2N_16(x) \
   x = ((((x) & 0xff00) >> 8) | \
        (((x) & 0x00ff) << 8))
-diff -ru libdvdnav-orig/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/src/dvdread/dvd_input.h  Sat Mar 12 17:36:26 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/dvd_input.h libdvdnav/src/dvdread/dvd_input.h
+--- libdvdnav-0.1.10/src/dvdread/dvd_input.h   2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav/src/dvdread/dvd_input.h  2005-08-31 19:56:21.000000000 +0200
 @@ -20,6 +20,8 @@
   * 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.
  /**
   * 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
---- libdvdnav-orig/src/dvdread/dvd_reader.c    Sat Mar 12 16:44:18 2005
-+++ libdvdnav/src/dvdread/dvd_reader.c Sat Mar 12 17:34:48 2005
-@@ -403,14 +403,16 @@
+diff -ru libdvdnav-0.1.10/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reader.c
+--- libdvdnav-0.1.10/src/dvdread/dvd_reader.c  2004-03-03 17:48:36.000000000 +0100
++++ libdvdnav/src/dvdread/dvd_reader.c 2005-08-31 19:58:34.000000000 +0200
+@@ -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. */
        {
@@ -189,7 +209,7 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reade
                if( new_path ) {
                    free( path_copy );
                    path_copy = new_path;
-@@ -585,10 +587,12 @@
+@@ -585,10 +585,12 @@
              sprintf( filename, "%s%s%s", path,
                       ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
                       ent->d_name );
@@ -202,9 +222,9 @@ diff -ru libdvdnav-orig/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reade
      return -1;
  }
  
-diff -ru libdvdnav-orig/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/src/dvdread/dvd_reader.h Sat Mar 12 17:43:28 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/dvd_reader.h libdvdnav/src/dvdread/dvd_reader.h
+--- libdvdnav-0.1.10/src/dvdread/dvd_reader.h  2004-02-01 18:55:19.000000000 +0100
++++ libdvdnav/src/dvdread/dvd_reader.h 2005-08-31 19:56:21.000000000 +0200
 @@ -21,6 +21,20 @@
   * 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
  #ifdef _MSC_VER
  #include <config.h>
  
-diff -ru libdvdnav-orig/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/src/dvdread/dvd_udf.h    Sat Mar 12 17:44:45 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/dvd_udf.h libdvdnav/src/dvdread/dvd_udf.h
+--- libdvdnav-0.1.10/src/dvdread/dvd_udf.h     2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav/src/dvdread/dvd_udf.h    2005-08-31 19:56:21.000000000 +0200
 @@ -31,6 +31,13 @@
   * 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
  #include <inttypes.h>
  
  #include "dvd_reader.h"
-diff -ru libdvdnav-orig/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/src/dvdread/ifo_print.h  Sat Mar 12 17:46:07 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/ifo_print.h libdvdnav/src/dvdread/ifo_print.h
+--- libdvdnav-0.1.10/src/dvdread/ifo_print.h   2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav/src/dvdread/ifo_print.h  2005-08-31 19:56:21.000000000 +0200
 @@ -20,6 +20,21 @@
  #ifndef 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.
  #include <inttypes.h>
  #ifdef DVDNAV_COMPILE
  #  include "ifo_types.h"
-diff -ru libdvdnav-orig/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/src/dvdread/ifo_read.h   Sat Mar 12 17:48:22 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/ifo_read.h libdvdnav/src/dvdread/ifo_read.h
+--- libdvdnav-0.1.10/src/dvdread/ifo_read.h    2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav/src/dvdread/ifo_read.h   2005-08-31 19:56:21.000000000 +0200
 @@ -20,6 +20,37 @@
   * 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
  #include "ifo_types.h"
  #include "dvd_reader.h"
  
-diff -ru libdvdnav-orig/src/dvdread/md5.h libdvdnav/src/dvdread/md5.h
---- libdvdnav-orig/src/dvdread/md5.h   Sat Mar 12 16:44:18 2005
-+++ libdvdnav/src/dvdread/md5.h        Sat Mar 12 17:49:33 2005
+diff -ru libdvdnav-0.1.10/src/dvdread/md5.h libdvdnav/src/dvdread/md5.h
+--- libdvdnav-0.1.10/src/dvdread/md5.h 2004-01-11 22:43:13.000000000 +0100
++++ libdvdnav/src/dvdread/md5.h        2005-08-31 19:56:21.000000000 +0200
 @@ -21,6 +21,14 @@
  #ifndef _MD5_H
  #define _MD5_H 1
index 6da659844b3f56c83f4f5fe740c933e8cb87e03a..e81321549366f4674933431ab3b8707b27514fa3 100644 (file)
@@ -1,6 +1,7 @@
-diff -ru libdvdread-orig/dvdread/bswap.h libdvdread/dvdread/bswap.h
---- libdvdread-orig/dvdread/bswap.h    Sat Mar 12 16:42:18 2005
-+++ libdvdread/dvdread/bswap.h Sat Mar 12 16:42:25 2005
+Only in libdvdread/dvdread: .dvd_input.c.swp
+diff -ru libdvdread-0.9.4/dvdread/bswap.h libdvdread/dvdread/bswap.h
+--- 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 @@
   * functionality! 
   */
@@ -10,10 +11,29 @@ diff -ru libdvdread-orig/dvdread/bswap.h libdvdread/dvdread/bswap.h
  #define B2N_16(x) \
   x = ((((x) & 0xff00) >> 8) | \
        (((x) & 0x00ff) << 8))
-diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
---- libdvdread-orig/dvdread/dvd_reader.c       Sat Mar 12 16:42:18 2005
-+++ libdvdread/dvdread/dvd_reader.c    Sat Mar 12 16:48:29 2005
-@@ -344,14 +344,16 @@
+diff -ru libdvdread-0.9.4/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
+--- libdvdread-0.9.4/dvdread/dvd_reader.c      2003-02-13 23:31:21.000000000 +0100
++++ libdvdread/dvdread/dvd_reader.c    2005-08-31 19:24:57.000000000 +0200
+@@ -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. */
        {
@@ -35,7 +55,7 @@ diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
                if( new_path ) {
                    free( path_copy );
                    path_copy = new_path;
-@@ -504,10 +506,12 @@
+@@ -504,10 +505,12 @@
              sprintf( filename, "%s%s%s", path,
                       ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
                       ent->d_name );
@@ -48,3 +68,4 @@ diff -ru libdvdread-orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
      return -1;
  }
  
+Only in libdvdread/dvdread: dvd_reader.c.orig
index debf4225a0d692db46a924c03ce5a0b98c087a6e..6471acd8432be0499776bb5f68adefd9e43c1aab 100644 (file)
 
 /* DVD and VCD devices */
 #if !defined( WIN32 ) && !defined( UNDER_CE )
-#   define DVD_DEVICE "/dev/dvd"
 #   define VCD_DEVICE "/dev/cdrom"
 #   define CDAUDIO_DEVICE "/dev/cdrom"
 #else
-#   define DVD_DEVICE "D:"
 #   define VCD_DEVICE "D:"
 #   define CDAUDIO_DEVICE "D:"
 #endif
index d2d11f512ca1e8839ae19a39bbffc047f8f04f8a..a814f6adee132ca059e6d762ce0e407ed862a16c 100644 (file)
@@ -176,13 +176,13 @@ static int Open( vlc_object_t *p_this )
         if( !p_this->b_force ) return VLC_EGENERIC;
 
         psz_name = var_CreateGetString( p_this, "dvd" );
-        if( !psz_name || !*psz_name )
+        if( !psz_name )
         {
-            if( psz_name ) free( psz_name );
-            return VLC_EGENERIC;
+            psz_name = strdup("");
         }
     }
-    else psz_name = strdup( p_demux->psz_path );
+    else
+        psz_name = strdup( p_demux->psz_path );
 
 #ifdef WIN32
     if( psz_name[0] && psz_name[1] == ':' &&
index 978c8fa0ab491435436df79539d6db2f11820e77..1667426339a29e1b57a26bdc3bf0a7bf9b71dce6 100644 (file)
@@ -192,13 +192,13 @@ static int Open( vlc_object_t *p_this )
         if( !p_this->b_force ) return VLC_EGENERIC;
 
         psz_name = var_CreateGetString( p_this, "dvd" );
-        if( !psz_name || !*psz_name )
+        if( !psz_name )
         {
-            if( psz_name ) free( psz_name );
-            return VLC_EGENERIC;
+            psz_name = strdup("");
         }
     }
-    else psz_name = strdup( p_demux->psz_path );
+    else
+        psz_name = strdup( p_demux->psz_path );
 
 #ifdef WIN32
     if( psz_name[0] && psz_name[1] == ':' &&
index e41d8752ff7d2ca0757e68684227ea210c5fc3cb..31669005752923e13638fa2503194285e6f5958d 100644 (file)
@@ -1112,7 +1112,7 @@ vlc_module_begin();
 
     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 );
     add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT,
               VLC_FALSE );