]> git.sesse.net Git - vlc/commitdiff
-fixed a bug in libdvdcss: the key wasn't searched when it had to.
authorStéphane Borel <stef@videolan.org>
Mon, 19 Nov 2001 15:13:11 +0000 (15:13 +0000)
committerStéphane Borel <stef@videolan.org>
Mon, 19 Nov 2001 15:13:11 +0000 (15:13 +0000)
dvdcss_seek : searches a new title key when
-the flag is DVDCSS_SEEK_KEY,
-the flag is DVDCSS_SEEK_MPEG, only if method is not "title".

dvdcss_seek with DVDCSS_SEEK_KEY flags does actually the same things as
dvdcss_title (which might eventually be removed).

Thus, the flag DVDCSS_SEEK_KEY (formerly DVDCSS_SEEK_INI) could not be
removed (sorry sam, I've mistaken you by forgetting that)

extras/libdvdcss/libdvdcss.c
extras/libdvdcss/videolan/dvdcss.h
plugins/dvd/input_dvd.c

index 3367df4a3b51a6c132b2d78912bc08cb5569509f..248dd322ea92d1596c90fc6f1037395af5cfbe60 100644 (file)
@@ -2,7 +2,7 @@
  * libdvdcss.c: DVD reading library.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.c,v 1.21 2001/11/13 02:03:46 sam Exp $
+ * $Id: libdvdcss.c,v 1.22 2001/11/19 15:13:11 stef Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -199,8 +199,9 @@ extern char * dvdcss_error ( dvdcss_handle dvdcss )
 extern int dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks, int i_flags )
 {
     /* title cracking method is too slow to be used at each seek */
-    if( !( i_flags & DVDCSS_SEEK_MPEG )
-             || ( dvdcss->i_method != DVDCSS_METHOD_TITLE ) )
+    if( ( ( i_flags & DVDCSS_SEEK_MPEG )
+             && ( dvdcss->i_method != DVDCSS_METHOD_TITLE ) ) 
+       || ( i_flags & DVDCSS_SEEK_KEY ) )
     {
         /* check the title key */
         if( dvdcss_title( dvdcss, i_blocks ) ) 
index 65637576d4838f3d530a3fe49d9c65514236f8bd..42c38171f6622aa3c70917a85ca545b61e5ce3c1 100644 (file)
@@ -2,7 +2,7 @@
  * libdvdcss.h: DVD reading library, exported functions.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvdcss.h,v 1.9 2001/11/13 01:25:05 sam Exp $
+ * $Id: dvdcss.h,v 1.10 2001/11/19 15:13:11 stef Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -35,6 +35,7 @@ typedef struct dvdcss_s* dvdcss_handle;
 #define DVDCSS_NOFLAGS         0
 #define DVDCSS_READ_DECRYPT    (1 << 0)
 #define DVDCSS_SEEK_MPEG       (1 << 0)
+#define DVDCSS_SEEK_KEY        (1 << 1)
 
 /*****************************************************************************
  * Exported prototypes
index d7803b761ae4f8ac1e55d7c90297b2a8ed2ce906..ea8c23cce4a7a29a5cb93fbd0608f199588b9619 100644 (file)
@@ -10,7 +10,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.97 2001/11/13 01:25:05 sam Exp $
+ * $Id: input_dvd.c,v 1.98 2001/11/19 15:13:11 stef Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -482,8 +482,9 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
         /* Force libdvdcss to check its title key.
          * It is only useful for title cracking method. Methods using the
          * decrypted disc key are fast enough to check the key at each seek */
+
         if( dvdcss_seek( p_dvd->dvdhandle, p_dvd->i_start,
-                                           DVDCSS_NOFLAGS ) < 0 )
+                               DVDCSS_SEEK_KEY ) < 0 )
         {
             intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
             return -1;