[libdvdcss-devel] [PATCH 2/3] Improve some error and debug messages.
Diego Biurrun
diego at biurrun.de
Mon Nov 17 22:13:38 CET 2014
---
src/css.c | 24 ++++++++++++------------
src/device.c | 13 ++++++-------
src/libdvdcss.c | 4 ++--
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/src/css.c b/src/css.c
index d29e671..caad8f0 100644
--- a/src/css.c
+++ b/src/css.c
@@ -124,7 +124,7 @@ int dvdcss_test( struct dvdcss *dvdcss )
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 @@ int dvdcss_test( struct dvdcss *dvdcss )
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 @@ int dvdcss_test( struct dvdcss *dvdcss )
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 @@ int dvdcss_disckey( struct dvdcss *dvdcss )
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 @@ int dvdcss_disckey( struct dvdcss *dvdcss )
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 @@ static int GetBusKey( struct dvdcss *dvdcss )
* 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 @@ static int GetBusKey( struct dvdcss *dvdcss )
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 );
}
@@ -1546,7 +1546,7 @@ static int CrackTitleKey( struct dvdcss *dvdcss, int i_pos, int i_len,
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 );
@@ -1558,12 +1558,12 @@ static int CrackTitleKey( struct dvdcss *dvdcss, int i_pos, int i_len,
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;
}
diff --git a/src/device.c b/src/device.c
index 26e7d61..32c73e0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -371,7 +371,7 @@ int dvdcss_open_device ( struct dvdcss *dvdcss )
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 @@ static int libc_open ( struct dvdcss *dvdcss, const char * const psz_device )
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 @@ static int win2k_open ( struct dvdcss *dvdcss, const char * const psz_device )
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 @@ static int os2_open ( dvdcss_t dvdcss, const char * const psz_device )
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 @@ static int win2k_readv ( struct dvdcss *dvdcss, const struct iovec *p_iovec,
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;
}
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 27379a9..3c15daf 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -182,8 +182,8 @@ static int set_access_method( struct dvdcss *dvdcss )
}
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;
--
2.1.0
More information about the libdvdcss-devel
mailing list