[libdvdcss-devel] [Git][videolan/libdvdcss][master] 6 commits: Update .gitignore
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Tue Sep 23 08:44:36 UTC 2025
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdcss
Commits:
7236f486 by Jean-Baptiste Kempf at 2025-09-23T10:18:00+02:00
Update .gitignore
- - - - -
24c231e5 by Jean-Baptiste Kempf at 2025-09-23T10:37:20+02:00
Fix whitespace in libdvdcpxm.c
- - - - -
e940120d by Jean-Baptiste Kempf at 2025-09-23T10:37:40+02:00
Rewrap long lines in libdvdcpxm.c
- - - - -
01a13b21 by Jean-Baptiste Kempf at 2025-09-23T10:38:15+02:00
Fix flag warning in libdvdcpxm.c
- - - - -
83d35315 by Jean-Baptiste Kempf at 2025-09-23T10:43:44+02:00
Fix initialization warnings in libdvdcpxm.c
- - - - -
c838ca97 by Jean-Baptiste Kempf at 2025-09-23T10:43:53+02:00
Update NEWS for 1.5.0
- - - - -
3 changed files:
- .gitignore
- NEWS
- src/libdvdcpxm.c
Changes:
=====================================
.gitignore
=====================================
@@ -34,3 +34,6 @@
/test/.libs
/test/csstest
/test/dvd_region
+/build*
+/releases*
+/tarballs*
=====================================
NEWS
=====================================
@@ -1,11 +1,12 @@
Changes between 1.4.3 and 1.5.0:
--------------------------------
- * Add support for DVD-Audio disc decryption via libdvdcpxm integration
+ * Add support for DVD-Audio disc decryption via libdvdcpxm integration
Add new dvdcpxm.h header for dvdcpxm function calls
Add dvdcpxm_read, dvdcpxm_readv, and dvdcpxm_seek functions
Add initialization and cleanup functions: dvdcpxm_init, dvdcpxm_close
- * Switch build system to Meson
+ * Switch build system to Meson, and removal of autotools support
+ * Miscellaneous cleanups and improvements to support more OSes and compilers
Changes between 1.4.2 and 1.4.3:
=====================================
src/libdvdcpxm.c
=====================================
@@ -170,7 +170,7 @@ void c2_init()
{
int i;
unsigned c0, c1, c2, c3;
-
+
for ( i = 0; i < 256; i++ )
{
c0 = sbox[i];
@@ -359,7 +359,8 @@ uint8_t *cprm_get_mkb( dvdcss_t dvdcss )
int mkb_packs, i;
mkb_packs = 16;
- if ( ioctl_ReadCPRMMKBPack( dvdcss->i_fd, &dvdcss->css.i_agid, 0, (uint8_t *) mkb_pack, &mkb_packs ) )
+ if ( ioctl_ReadCPRMMKBPack( dvdcss->i_fd, &dvdcss->css.i_agid, 0,
+ (uint8_t *) mkb_pack, &mkb_packs ) )
return NULL;
p_mkb = malloc( mkb_packs * CPRM_MKB_PACK_SIZE - 16 );
@@ -371,7 +372,8 @@ uint8_t *cprm_get_mkb( dvdcss_t dvdcss )
for ( i = 1; i < mkb_packs; i++ )
{
- if ( ioctl_ReadCPRMMKBPack( dvdcss->i_fd,&dvdcss->css.i_agid, i, (uint8_t *) p_mkb + i * CPRM_MKB_PACK_SIZE - 16, &mkb_packs ) )
+ if ( ioctl_ReadCPRMMKBPack( dvdcss->i_fd,&dvdcss->css.i_agid, i,
+ (uint8_t *) p_mkb + i * CPRM_MKB_PACK_SIZE - 16, &mkb_packs ) )
{
free( p_mkb );
p_mkb = NULL;
@@ -384,15 +386,18 @@ uint8_t *cprm_get_mkb( dvdcss_t dvdcss )
#define f( c, r ) (((uint64_t) c << 32) | (uint64_t) r)
-/* this function retrieves the main key used to decryption, this key is derived from applying the C2 cypher to the MKB
- * and the DVD-Audio player device keys, as well as a unique album_id and media_id */
+/* This function retrieves the main key used to decryption; this key is derived
+ * from applying the C2 cypher to the MKB and the DVD-Audio player device keys,
+ * as well as a unique album_id and media_id */
int process_mkb( uint8_t *p_mkb, device_key_t *p_dev_keys, int nr_dev_keys, uint64_t *p_media_key )
{
int mkb_pos, length, i, i_dev_key, no_more_keys, no_more_records;
uint8_t record_type, column;
uint64_t buffer, media_key, verification_data;
- i_dev_key = 0;
- no_more_keys = 0;
+
+ /* Init everything */
+ i_dev_key = no_more_keys = 0;
+ buffer = media_key = verification_data = 0;
while ( !no_more_keys )
{
@@ -510,10 +515,12 @@ int vr_get_k_te( cpxm cpxm,char *psz_vr_mangr )
return ret;
}
-/* function should be called on a dvdcss var to set cppm struct which needs to persist in order to decrypt the media */
+/* Function should be called on a dvdcss var to set cppm struct which needs
+ * to persist in order to decrypt the media */
LIBDVDCSS_EXPORT int dvdcpxm_init( dvdcss_t dvdcss, uint8_t *p_mkb )
{
- /* in the case that p_mkb is received as null, then either you were unable to read the mkb or the encryption type is cprm */
+ /* In the case that p_mkb is received as null, then either you were unable
+ * to read the mkb or the encryption type is cprm */
char psz_file[PATH_MAX];
int ret = -1;
@@ -528,7 +535,9 @@ LIBDVDCSS_EXPORT int dvdcpxm_init( dvdcss_t dvdcss, uint8_t *p_mkb )
{
if ( p_mkb )
{
- ret = process_mkb(p_mkb, cppm_device_keys, sizeof(cppm_device_keys) / sizeof(*cppm_device_keys), &dvdcss->cpxm.media_key);
+ ret = process_mkb( p_mkb, cppm_device_keys,
+ sizeof(cppm_device_keys) / sizeof(*cppm_device_keys),
+ &dvdcss->cpxm.media_key );
free(p_mkb);
if (ret) break;
}
@@ -540,7 +549,9 @@ LIBDVDCSS_EXPORT int dvdcpxm_init( dvdcss_t dvdcss, uint8_t *p_mkb )
p_mkb = cprm_get_mkb( dvdcss );
if ( p_mkb )
{
- ret = process_mkb( p_mkb, cprm_device_keys, sizeof( cprm_device_keys ) / sizeof( *cprm_device_keys ), &dvdcss->cpxm.media_key );
+ ret = process_mkb( p_mkb, cprm_device_keys,
+ sizeof( cprm_device_keys ) / sizeof( *cprm_device_keys ),
+ &dvdcss->cpxm.media_key );
free( p_mkb );
if (ret) break;
}
@@ -559,7 +570,7 @@ LIBDVDCSS_EXPORT int dvdcpxm_init( dvdcss_t dvdcss, uint8_t *p_mkb )
return dvdcss->media_type;
}
-/* makes sure that the block is encrypted */
+/* Ensures that the block is encrypted */
int mpeg2_check_pes_scrambling_control( uint8_t *p_block )
{
int pes_scrambling_control;
@@ -620,8 +631,8 @@ void mpeg2_reset_cci( uint8_t *p_block )
}
}
-/* inside this header are fields relating to the type of packet and DVD-Audio specifications */
-/* there are also a set of keys at different addresses that are used by CPPM to decrypt the block*/
+/* Inside this header are fields relating to the type of packet and DVD-Audio specifications. */
+/* There are also a set of keys at different addresses that are used by CPPM to decrypt the block */
/* only the last 1920 bytes contain protected content, the first 180 bytes are left untouched. */
int cppm_decrypt_block( uint8_t *p_buffer, int flags, uint64_t id_album, uint64_t media_key )
{
@@ -734,7 +745,7 @@ int dvdcpxm_read ( dvdcss_t dvdcss, void *p_buffer,
{
return i_ret;
}
-
+
/* Decrypt the blocks we managed to read */
for( i_index = i_ret; i_index; i_index-- )
{
@@ -745,7 +756,9 @@ int dvdcpxm_read ( dvdcss_t dvdcss, void *p_buffer,
return i_ret;
}
-int dvdcpxm_seek ( dvdcss_t dvdcss, int i_blocks, int i_flags ){
+int dvdcpxm_seek ( dvdcss_t dvdcss, int i_blocks, int i_flags )
+{
+ (void)i_flags;
return dvdcss->pf_seek( dvdcss, i_blocks );
}
View it on GitLab: https://code.videolan.org/videolan/libdvdcss/-/compare/cec58b6082d84c60f8862cb70d9cab3b9333eb1f...c838ca97553aeb8505b7baf02b9a90f8505de212
--
View it on GitLab: https://code.videolan.org/videolan/libdvdcss/-/compare/cec58b6082d84c60f8862cb70d9cab3b9333eb1f...c838ca97553aeb8505b7baf02b9a90f8505de212
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the libdvdcss-devel
mailing list