[libdvdnav-devel] [Git][videolan/libdvdread][master] 2 commits: dvdread: decrypt DVD-Audio VOBs with CPPM instead of CSS

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jul 11 16:14:55 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread


Commits:
bdd19ba5 by Saifelden Mohamed Ismail at 2026-07-11T18:14:12+02:00
dvdread: decrypt DVD-Audio VOBs with CPPM instead of CSS

- - - - -
4c0e1a80 by Saifelden Mohamed Ismail at 2026-07-11T18:14:12+02:00
dvdread: guard cpxm init against a null device on directory-tree opens

- - - - -


1 changed file:

- src/dvd_reader.c


Changes:

=====================================
src/dvd_reader.c
=====================================
@@ -346,7 +346,10 @@ static uint8_t *cppm_get_mkb_or_backup( dvd_reader_t *ctx, int backup );
 /* this should only be called if libdvdcss is available and if the disc type is DVD-Audio */
 static int cpxm_init_condition( dvd_reader_t* ctx, dvd_type_t type, int have_css )
 {
-  if ( type == DVD_A && have_css ) 
+  if ( !ctx->rd->dev )
+    return 0;
+
+  if ( type == DVD_A && have_css )
   {
     uint8_t *p_mkb = NULL;
     p_mkb = cppm_get_mkb_or_backup( ctx, 0 );
@@ -1110,8 +1113,7 @@ static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *ctx, int title, int menu )
   /* stream type must be set to determine decryption method*/
   /* DVD-Audio discs contain both AOBs and VOBs */
   /* DVD_V = VOB with css, DVD_A = AOB with CPPM, DVD_VR = VRO with CPRM */
-  dvd_type_t stream_type = (ctx->dvd_type == DVD_VR) ? DVD_VR :
-        (menu ? DVD_V : ctx->dvd_type);
+  dvd_type_t stream_type;
 
   if ( ctx->dvd_type == DVD_VR && menu )
     return NULL;
@@ -1132,6 +1134,14 @@ static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *ctx, int title, int menu )
       /* DVD_Audio title menu */
       sprintf( filename, "/AUDIO_TS/AUDIO_SV.VOB" );
   }
+
+  if ( ctx->dvd_type == DVD_VR )
+    stream_type = DVD_VR;
+  else if ( !strncmp( filename, "/VIDEO_TS/", 10 ) )
+    stream_type = DVD_V;
+  else
+    stream_type = DVD_A;
+
   start = UDFFindFile( ctx, filename, &len );
   if( start == 0 ) return NULL;
 
@@ -1163,11 +1173,6 @@ static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *ctx, int title, int menu )
     initAllCSSKeys( ctx );
     ctx->rd->css_state = 2;
   }
-  /*
-  if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) {
-      Log0(ctx, "Error cracking CSS key for %s", filename );
-  }
-  */
 
   dvdinput_set_stream( ctx->rd->dev, stream_type );
   return dvd_file;
@@ -1183,8 +1188,7 @@ static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *ctx, int title, int menu )
   /* for now will set as the dvd_type,
    * when hybrid discs are implemented set as title type */
   /* DVD_V = VOB with css, DVD_A = AOB with CPPM, DVD_VR = VRO with CPRM */
-  dvd_type_t stream_type = (ctx->dvd_type == DVD_VR) ? DVD_VR :
-        (menu ? DVD_V : ctx->dvd_type);
+  dvd_type_t stream_type = ctx->dvd_type;
 
   dvd_file = calloc( 1, sizeof( dvd_file_t ) );
   if( !dvd_file ) return NULL;



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/980143e2192aded576c54a60dd230fa22937b637...4c0e1a800cda716a2b432cd66a30dfa7e835a749

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/980143e2192aded576c54a60dd230fa22937b637...4c0e1a800cda716a2b432cd66a30dfa7e835a749
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the libdvdnav-devel mailing list