[libdvdnav-devel] [Git][videolan/libdvdread][master] 4 commits: dvd_input: read unencrypted DVD-Audio discs without a key

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Aug 15 09:10:43 UTC 2026



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


Commits:
85296dd7 by Saifelden Mohamed Ismail at 2026-08-15T10:54:40+02:00
dvd_input: read unencrypted DVD-Audio discs without a key

- - - - -
de61288b by Saifelden Mohamed Ismail at 2026-08-15T10:54:40+02:00
ifo_read: stop claiming the video format before the identifier is checked

- - - - -
58d5c6e8 by Saifelden Mohamed Ismail at 2026-08-15T10:54:40+02:00
ifo_read: read the album menu when asked for the menu table

- - - - -
32d2392b by Saifelden Mohamed Ismail at 2026-08-15T10:54:40+02:00
dvd_reader: detect the disc type of a directory tree

- - - - -


3 changed files:

- src/dvd_input.c
- src/dvd_reader.c
- src/ifo_read.c


Changes:

=====================================
src/dvd_input.c
=====================================
@@ -109,6 +109,8 @@ struct dvd_input_s {
   /* DVD_VR -> VRO with cprm */
   dvd_type_t stream_type;
 
+  int cpxm_ready;
+
   /* stream input */
   dvd_reader_stream_cb *stream_cb;
   /* file input */
@@ -125,6 +127,7 @@ static dvd_input_t dvd_input_New(void *priv, dvd_logger_cb *logcb)
       dev->logcb = logcb;
       dev->ipos = 0;
       dev->stream_type = DVD_V;
+      dev->cpxm_ready = 0;
 
       /* Initialize all inputs to safe defaults */
       dev->dvdcss = NULL;
@@ -203,7 +206,8 @@ static int css_title(dvd_input_t dev, int block)
 static int css_read(dvd_input_t dev, void *buffer, int blocks, int flags)
 {
 #ifdef HAVE_DVDCSS_DVDCPXM_H
-  if (dev->stream_type == DVD_A || dev->stream_type == DVD_VR)
+  if ((dev->stream_type == DVD_A || dev->stream_type == DVD_VR) &&
+      dev->cpxm_ready)
     return DVDcpxm_read(dev->dvdcss, buffer, blocks, flags);
   else
 #endif
@@ -230,7 +234,11 @@ static int css_close(dvd_input_t dev)
  */
 static int cpxm_init(dvd_input_t dev, uint8_t* p_mkb )
 {
-  return DVDcpxm_init(dev->dvdcss, p_mkb);
+  int ret = DVDcpxm_init(dev->dvdcss, p_mkb);
+
+  dev->cpxm_ready = ret >= 0;
+
+  return ret;
 }
 #endif /* CPXM */
 


=====================================
src/dvd_reader.c
=====================================
@@ -754,6 +754,26 @@ static dvd_type_t DVDProbeType( const char *ppath, void *stream,
     return ret;
   }
 
+  /* A directory tree has no UDF to read, so go by its layout instead. It has
+   * to be settled here because opening a directory as an image succeeds. */
+  if (ppath) {
+    dvdstat_t fileinfo;
+
+    if( ctx->fs->stat( ctx->fs, ppath, &fileinfo ) == 0 &&
+        ( fileinfo.st_mode & DVD_S_IFMT ) == DVD_S_IFDIR ) {
+      ctx->rd = DVDOpenPath( ppath );
+      if( ctx->rd ) {
+        if( disc_dir_has( ctx, "AUDIO_TS", "AUDIO_TS.IFO" ) &&
+            !disc_dir_has( ctx, "VIDEO_TS", "VIDEO_TS.IFO" ) )
+          ret = DVD_A;
+        else if( disc_dir_has( ctx, "DVD_RTAV", "VR_MANGR.IFO" ) )
+          ret = DVD_VR;
+      }
+      DVDClose( ctx );
+      return ret;
+    }
+  }
+
   have_css = dvdinput_setup( ctx, &ctx->logcb, DVD_V );
 
   if (stream && stream_cb)


=====================================
src/ifo_read.c
=====================================
@@ -880,7 +880,6 @@ static int ifoRead_VMG(ifo_handle_t *ifofile) {
     return 0;
 
   ifofile->vmgi_mat = vmgi_mat;
-  ifofile->ifo_format= IFO_VIDEO;
 
   if(!DVDFileSeek_(ifop->file, 0)) {
     free(ifofile->vmgi_mat);
@@ -3454,6 +3453,12 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
   if(!ifofile)
     return 0;
 
+  if(ifofile->ifo_format == IFO_AUDIO)
+    return ifoRead_AMGM_PGCI_UT(ifofile);
+
+  if(ifofile->ifo_format != IFO_VIDEO)
+    return 0;
+
   if(ifofile->vmgi_mat) {
     if(ifofile->vmgi_mat->vmgm_pgci_ut == 0)
       return 1;
@@ -3473,6 +3478,9 @@ static int ifoRead_AMGM_PGCI_UT(ifo_handle_t *ifofile) {
   if(!ifofile || !ifofile->amgi_mat)
     return 0;
 
+  if(ifofile->amgm_pgci_ut)
+    return 1;
+
   if(ifofile->amgi_mat->amgm_pgci_ut_sa == 0)
     return 1;
 



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/859008d961c365986fe1d9b40d0d5384b985a49d...32d2392bc8ac4530b0873a6aa8ce4e44f8472c8d

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/859008d961c365986fe1d9b40d0d5384b985a49d...32d2392bc8ac4530b0873a6aa8ce4e44f8472c8d
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