shithub: libdvdcss

Download patch

ref: dde02c78d8e40828fb077ef69d5112edf5cc714d
parent: df37e6e222bcd2504b0fe7434bfd69429750d428
author: Diego Biurrun <diego@biurrun.de>
date: Mon Nov 17 16:58:21 EST 2014

Improve some error and debug messages.

--- a/src/css.c
+++ b/src/css.c
@@ -124,7 +124,7 @@
     if( i_ret < 0 )
     {
         /* Since it's the first ioctl we try to issue, we add a notice */
-        print_error( dvdcss, "css error: could not get \"copyright\""
+        print_error( dvdcss, "CSS error: could not get \"copyright\""
                      " information, make sure there is a DVD in the drive,"
                      " and that you have used the correct device node." );
 
@@ -138,7 +138,7 @@
 
     if( i_ret < 0 )
     {
-        print_error( dvdcss, "css error: could not get RPC (Regional Playback "
+        print_error( dvdcss, "CSS error: could not get RPC (Regional Playback "
                      "Control) status. Assuming RPC-I drive." );
         i_type = i_mask = i_rpc = 0;
     }
@@ -164,7 +164,7 @@
 
     if( i_copyright && i_rpc == 1 && i_type == 0 )
     {
-        print_error( dvdcss, "css error: drive will prevent access to "
+        print_error( dvdcss, "CSS error: drive will prevent access to "
                              "scrambled data" );
         return -3;
     }
@@ -354,8 +354,8 @@
     if( GetASF( dvdcss ) != 1 )
     {
         /* Region mismatch (or region not set) is the most likely source. */
-        print_error( dvdcss,
-                     "ASF not 1 after reading disc key (region mismatch?)" );
+        print_error( dvdcss, "authentication success flag (ASF) not 1 after "
+                             "reading disc key (region mismatch?)" );
         ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
         return -1;
     }
@@ -404,7 +404,7 @@
 
         default:
 
-            print_debug( dvdcss, "disc key needs not be decrypted" );
+            print_debug( dvdcss, "disc key does not need to be decrypted" );
             memset( p_disc_key, 0, DVD_KEY_SIZE );
             break;
     }
@@ -608,8 +608,8 @@
      * and try again. */
     for( i = 0; i_ret == -1 && i < 4 ; ++i )
     {
-        print_debug( dvdcss, "ioctl ReportAgid failed, "
-                             "invalidating AGID %d", i );
+        print_debug( dvdcss, "ioctl ReportAgid failed, invalidating "
+                             "authentication grant ID (AGID) %d", i );
 
         /* This is really _not good_, should be handled by the OS.
          * Invalidating an AGID could make another process fail somewhere
@@ -617,7 +617,7 @@
         dvdcss->css.i_agid = i;
         ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
 
-        print_debug( dvdcss, "requesting AGID" );
+        print_debug( dvdcss, "requesting authentication grant ID (AGID)" );
         i_ret = ioctl_ReportAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
     }
 
@@ -1544,7 +1544,7 @@
             else if( !b_read_error )
             {
                 print_debug( dvdcss, "read error at block %i, resorting to "
-                                     "secret arcanes to recover", i_pos );
+                                     "arcane secrets to recover", i_pos );
 
                 /* Reset the drive before trying to continue */
                 dvdcss_close_device( dvdcss );
@@ -1556,12 +1556,12 @@
             break;
         }
 
-        /* Stop when we find a non MPEG stream block.
+        /* Stop when we find a non-MPEG stream block.
          * (We must have reached the end of the stream).
          * For now, allow all blocks that begin with a start code. */
         if( memcmp( p_buf, p_packstart, 3 ) )
         {
-            print_debug( dvdcss, "non MPEG block found at block %i "
+            print_debug( dvdcss, "block %i is a non-MPEG block "
                                  "(end of title)", i_pos );
             break;
         }
--- a/src/device.c
+++ b/src/device.c
@@ -371,7 +371,7 @@
     else
 #endif /* defined( WIN32 ) || defined( __OS2__ ) */
     {
-        print_debug( dvdcss, "using libc for access" );
+        print_debug( dvdcss, "using libc API for access" );
         dvdcss->pf_seek  = libc_seek;
         dvdcss->pf_read  = libc_read;
         dvdcss->pf_readv = libc_readv;
@@ -416,9 +416,8 @@
 
     if( dvdcss->i_fd == -1 )
     {
-        print_debug( dvdcss, "cannot open %s (%s)",
-                             psz_device, strerror(errno) );
-        print_error( dvdcss, "failed to open device" );
+        print_error( dvdcss, "failed to open device %s (%s)",
+                     psz_device, strerror(errno) );
         return -1;
     }
 
@@ -451,7 +450,7 @@
 
     if( dvdcss->p_handle == INVALID_HANDLE_VALUE )
     {
-        print_error( dvdcss, "failed opening device" );
+        print_error( dvdcss, "failed to open device %s", psz_device );
         return -1;
     }
 
@@ -478,7 +477,7 @@
 
     if( rc )
     {
-        print_error( dvdcss, "failed to open device" );
+        print_error( dvdcss, "failed to open device %s", psz_device );
         return -1;
     }
 
@@ -702,7 +701,7 @@
         dvdcss->p_readv_buffer = malloc( dvdcss->i_readv_buf_size );
         if( !dvdcss->p_readv_buffer )
         {
-            print_error( dvdcss, " failed (readv)" );
+            print_error( dvdcss, "scatter input (readv) failed" );
             dvdcss->i_pos = -1;
             return -1;
         }
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -182,8 +182,8 @@
     }
     else
     {
-        print_error( dvdcss, "unknown decrypt method, please choose "
-                     "from 'title', 'key' or 'disc'" );
+        print_error( dvdcss, "unknown decryption method %s, please choose "
+                     "from 'title', 'key' or 'disc'", psz_method );
         return -1;
     }
     return 0;