[libdvdnav-devel] [Git][videolan/libdvdread][master] 5 commits: DVD-Audio: split unknown number in zero_4, AMGI_MAT

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Aug 11 10:26:47 UTC 2025



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


Commits:
aaceb8cb by Saifelden Mohamed Ismail at 2025-08-11T10:26:25+00:00
DVD-Audio: split unknown number in zero_4, AMGI_MAT

- - - - -
aecd2f8f by Saifelden Mohamed Ismail at 2025-08-11T10:26:25+00:00
DVD-Audio: use DVD_TYPE_STRING macro in dvd_udf

- - - - -
123c8930 by Saifelden Mohamed Ismail at 2025-08-11T10:26:25+00:00
DVD-Audio: byteswap last byte address for title table

- - - - -
fe6a4a79 by Saifelden Mohamed Ismail at 2025-08-11T10:26:25+00:00
DVD-Audio: sanity check for tracks info table

- - - - -
1a04985d by Saifelden Mohamed Ismail at 2025-08-11T10:26:25+00:00
DVD-Audio: check DVD spec version for amgi_mat

- - - - -


3 changed files:

- src/dvd_udf.c
- src/dvdread/ifo_types.h
- src/ifo_read.c


Changes:

=====================================
src/dvd_udf.c
=====================================
@@ -887,7 +887,7 @@ uint32_t UDFFindFile( dvd_reader_t *ctx, const char *filename,
         return 0;
       if( !UDFMapICB( ctx, ICB, &filetype, &partition, &File ) )
         return 0;
-      if(!strcmp(token, "VIDEO_TS"))
+      if(!strcmp(token, DVD_TYPE_STRING( ctx->dvd_type ) ))
         cache_file_info = 1;
       token = strtok( NULL, "/" );
     }


=====================================
src/dvdread/ifo_types.h
=====================================
@@ -509,18 +509,19 @@ typedef struct {
   uint8_t  zero_3[4];
   uint8_t  autoplay;
   uint32_t audio_sv_ifo_relative_p;
-  uint8_t  zero_4[10];
+  uint16_t unknown_1; /* some discs have a value here, undocumented in DVD-Audio specs */
+  uint8_t  zero_4[8];
   uint8_t  vmg_nr_of_title_sets;  /* Number of video titlesets in audio zone. */
   uint8_t  amg_nr_of_title_sets;  /* Number of audio titlesets in audio zone. */
-  uint8_t  unknown_1[32]; /* may be set to zeros */
-  uint8_t  unknown_2[8]; /* may be set to zeros */
+  uint8_t  unknown_2[32]; /* may be set to zeros */
+  uint8_t  unknown_3[8]; /* may be set to zeros */
   uint8_t  zero_5[24];  
   uint32_t amg_end_byte_address;
-  uint8_t  unknown_3[4]; /* may be set to zeros */
+  uint8_t  unknown_4[4]; /* may be set to zeros */
   uint8_t  zero_6[56];  
   uint16_t menu_prescence_1; /* may be set to zero, or some other value, optional field*/
-  uint8_t  unknown_4[4];  
-  uint16_t unknown_5; /* should be 0x01 */
+  uint8_t  unknown_5[4];  
+  uint16_t unknown_6; /* should be 0x01 */
   uint8_t  zero_7[2];  
   uint16_t amg_nr_of_zones; /* may be set to 0x02*/
   uint8_t  zero_8[2];  


=====================================
src/ifo_read.c
=====================================
@@ -836,6 +836,7 @@ static int ifoRead_TT(ifo_handle_t *ifofile){
   }
 
   B2N_16(atsi_title_table->nr_titles);
+  B2N_32(atsi_title_table->last_byte_address);
 
   atsi_title_table->atsi_index_rows= calloc(atsi_title_table->nr_titles,sizeof(atsi_title_index_t));
   if(!atsi_title_table->atsi_index_rows){
@@ -981,6 +982,15 @@ static int ifoRead_TIF(ifo_handle_t *ifofile, int sector_offset){
     B2N_32(tracks_info_table->tracks_info[i].ts_pointer_relative_sector);
   }
 
+  /* sanity check */
+  /* sector table two's size and end byte are always the same as sector one's table
+   * even though it will be equal to or smaller, since it only lists audio titles 
+   * sector two's table has been resized in the ifo to match it's true size */
+  if( sector_offset == 1 )
+    CHECK_VALUE( (TRACKS_INFO_TABLE_SIZE + 
+                  tracks_info_table->nr_of_titles * TRACK_INFO_SIZE -
+                  1) == tracks_info_table->last_byte_in_table );
+
   switch (sector_offset) {
     case 1:
       ifofile->info_table_first_sector= tracks_info_table;
@@ -1028,6 +1038,7 @@ static int ifoRead_AMG(ifo_handle_t *ifofile) {
   B2N_32(amgi_mat->amg_start_sector);
   B2N_32(amgi_mat->amgi_last_sector);
   B2N_16(amgi_mat->amg_nr_of_volumes);
+  B2N_16(amgi_mat->specification_version);
   B2N_16(amgi_mat->amg_this_volume_nr);
   B2N_16(amgi_mat->amg_nr_of_zones);
   CHECK_ZERO(amgi_mat->zero_1);
@@ -1040,6 +1051,7 @@ static int ifoRead_AMG(ifo_handle_t *ifofile) {
   CHECK_ZERO(amgi_mat->zero_8);
   CHECK_ZERO(amgi_mat->zero_9);
   CHECK_ZERO(amgi_mat->zero_10);
+  CHECK_VALUE(amgi_mat->specification_version == 0x0012);
 
   return 1;
 }



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/9dd63fdc7d4fd10b0c3ce462219b222d2bd9186c...1a04985d2e0139bececd84ec4b499c5c8d4477b0

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/9dd63fdc7d4fd10b0c3ce462219b222d2bd9186c...1a04985d2e0139bececd84ec4b499c5c8d4477b0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the libdvdnav-devel mailing list