shithub: libdvdcss

Download patch

ref: f13b902be9a8a91099653e11da61969ea69db3e8
parent: 2de79ff6caa5045aae19d23169d7f6c8b4b8baed
author: Diego Biurrun <[email protected]>
date: Fri Oct 24 07:11:53 EDT 2014

Improve some comments in dvdcss_open() and fix some typos.

--- a/src/css.c
+++ b/src/css.c
@@ -466,7 +466,7 @@
 
             case 1:
                 /* Drive status is OK. */
-                /* If the title key request failed, but we did not loose ASF,
+                /* If the title key request failed, but we did not lose ASF,
                  * we might still have the AGID.  Other code assumes that we
                  * will not after this so invalidate it(?). */
                 if( i_ret < 0 )
--- a/src/device.c
+++ b/src/device.c
@@ -372,7 +372,7 @@
     if( psz_device[0] && psz_device[1] == ':' &&
         ( !psz_device[2] || ( psz_device[2] == '\\' && !psz_device[3] ) ) )
     {
-        print_debug( dvdcss, "using OS2 API for access" );
+        print_debug( dvdcss, "using OS/2 API for access" );
         dvdcss->pf_seek  = os2_seek;
         dvdcss->pf_read  = os2_read;
         dvdcss->pf_readv = os2_readv;
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -1528,7 +1528,7 @@
 /*****************************************************************************
  * OS2InitSDC: initialize a SDC structure for the Execute SCSI-command
  *****************************************************************************
- * This function initializes a OS2 'execute SCSI command' structure for
+ * This function initializes an OS/2 'execute SCSI command' structure for
  * future use, either a read command or a write command.
  *****************************************************************************/
 static void OS2InitSDC( struct OS2_ExecSCSICmd *p_sdc, int i_type )
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -103,7 +103,7 @@
 #endif
 
 /*****************************************************************************
- * Additional types, OpenBSD specific
+ * Additional types, OpenBSD-specific
  *****************************************************************************/
 #if defined( HAVE_OPENBSD_DVD_STRUCT )
 typedef union dvd_struct dvd_struct;
@@ -137,7 +137,7 @@
 #define DVDCSS_INVALIDATE_AGID   0x3f
 
 /*****************************************************************************
- * win32 ioctl specific
+ * Win32-ioctl-specific
  *****************************************************************************/
 #if defined( WIN32 )
 
@@ -264,7 +264,7 @@
 #endif /* defined( WIN32 ) */
 
 /*****************************************************************************
- * OS2 ioctl specific
+ * OS/2-ioctl-specific
  *****************************************************************************/
 #if defined( __OS2__ )
 
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -160,20 +160,14 @@
     const char *psz_raw_device = getenv( "DVDCSS_RAW_DEVICE" );
 #endif
 
-    dvdcss_t dvdcss;
-
-    /*
-     *  Allocate the library structure
-     */
-    dvdcss = malloc( sizeof( struct dvdcss_s ) );
+    /* Allocate the library structure. */
+    dvdcss_t dvdcss = malloc( sizeof( struct dvdcss_s ) );
     if( dvdcss == NULL )
     {
         return NULL;
     }
 
-    /*
-     *  Initialize structure with default values
-     */
+    /* Initialize structure with default values. */
 #ifdef DVDCSS_RAW_OPEN
     dvdcss->i_raw_fd = -1;
 #endif
@@ -185,9 +179,7 @@
     dvdcss->b_debug = 0;
     dvdcss->b_errors = 0;
 
-    /*
-     *  Find verbosity from DVDCSS_VERBOSE environment variable
-     */
+    /* Set library verbosity from DVDCSS_VERBOSE environment variable. */
     if( psz_verbose != NULL )
     {
         int i = atoi( psz_verbose );
@@ -196,9 +188,7 @@
         if( i >= 1 ) dvdcss->b_errors = 1;
     }
 
-    /*
-     *  Find method from DVDCSS_METHOD environment variable
-     */
+    /* Set DVD access method from DVDCSS_METHOD environment variable. */
     if( psz_method != NULL )
     {
         if( !strncmp( psz_method, "key", 4 ) )
@@ -221,9 +211,7 @@
         }
     }
 
-    /*
-     *  If DVDCSS_CACHE was not set, try to guess a default value
-     */
+    /* Set CSS key cache directory. */
     if( psz_cache == NULL || psz_cache[0] == '\0' )
     {
 #if defined(_WIN32_IE) && _WIN32_IE >= 0x500
@@ -288,9 +276,7 @@
 #endif /* ! defined(_WIN32_IE) && _WIN32_IE >= 0x500 */
     }
 
-    /*
-     *  Find cache dir from the DVDCSS_CACHE environment variable
-     */
+    /* Sanity check psz_cache value. */
     if( psz_cache != NULL )
     {
         if( psz_cache[0] == '\0' || !strcmp( psz_cache, "off" ) )
@@ -306,9 +292,7 @@
         }
     }
 
-    /*
-     *  Open device
-     */
+    /* Open device. */
     dvdcss_check_device( dvdcss );
     i_ret = dvdcss_open_device( dvdcss );
     if( i_ret < 0 )
@@ -464,8 +448,8 @@
             }
         }
 
-        /* Get disk key, since some discs have got same title, manufacturing
-         * date and serial number, but different keys */
+        /* Get disk key, since some discs have the same title, manufacturing
+         * date and serial number, but different keys. */
         if( dvdcss->b_scrambled )
         {
              psz_key[0] = '-';
@@ -516,7 +500,7 @@
     }
 #endif /* DVDCSS_RAW_OPEN */
 
-    /* Seek at the beginning, just for safety. */
+    /* Seek to the beginning, just for safety. */
     dvdcss->pf_seek( dvdcss, 0 );
 
     return dvdcss;