]> git.sesse.net Git - vlc/blobdiff - extras/libdvdcss/libdvdcss.c
* Fixed a Win32 bug in libdvdcss. This bug was appearing on title change.
[vlc] / extras / libdvdcss / libdvdcss.c
index af6f8e40ec5590769cd40cfe02352ac441169bcf..30b037f43ae8b41fb2bb9428a7eedde76b0f36bf 100644 (file)
@@ -2,7 +2,7 @@
  * libdvdcss.c: DVD reading library.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.c,v 1.11 2001/07/28 02:17:37 sam Exp $
+ * $Id: libdvdcss.c,v 1.13 2001/07/30 18:56:35 gbazin Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -38,8 +38,7 @@
 #endif
 
 #if defined( WIN32 )
-#   include <io.h>
-#   include "input_iovec.h"
+#   include <io.h>                                                 /* read() */
 #else
 #   include <sys/uio.h>                                      /* struct iovec */
 #endif
 #include "config.h"
 #include "common.h"
 
+#if defined( WIN32 )
+#   include "input_iovec.h"
+#endif
+
 #include "videolan/dvdcss.h"
 #include "libdvdcss.h"
 #include "ioctl.h"
@@ -457,6 +460,8 @@ static int _dvdcss_close ( dvdcss_handle dvdcss )
 static int _dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
 {
 #if defined( WIN32 )
+    dvdcss->i_seekpos = i_blocks;
+
     if( WIN2K )
     {
         LARGE_INTEGER li_read;
@@ -807,7 +812,7 @@ static int _win32_dvdcss_aread( int i_fd, void *p_data, int i_blocks )
 
         /* transfer the next 64kb (_win32_dvdcss_aread is called recursively)
          * We need to check the status of the read on return */
-        if( _win32_dvdcss_aread( i_fd, p_data + 32 * DVDCSS_BLOCK_SIZE,
+        if( _win32_dvdcss_aread( i_fd, (u8*) p_data + 32 * DVDCSS_BLOCK_SIZE,
                                  i_blocks - 32) < 0 )
         {
             return -1;