[libdvdnav-devel] [PATCH 3/4] Update incomplete structures
Pierre Lamot
pierre at videolabs.io
Tue Jan 9 15:52:16 CET 2018
---
src/dvdread/ifo_types.h | 14 ++++++++------
src/ifo_print.c | 4 ++--
src/ifo_read.c | 7 ++++---
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/src/dvdread/ifo_types.h b/src/dvdread/ifo_types.h
index 33f0346..22ece66 100644
--- a/src/dvdread/ifo_types.h
+++ b/src/dvdread/ifo_types.h
@@ -215,10 +215,10 @@ typedef struct {
unsigned int interleaved : 1;
unsigned int stc_discontinuity: 1;
unsigned int seamless_angle : 1;
-
+ unsigned int zero_1 : 1;
unsigned int playback_mode : 1; /**< When set, enter StillMode after each VOBU */
unsigned int restricted : 1; /**< ?? drop out of fastforward? */
- unsigned int unknown2 : 6;
+ unsigned int cell_type : 5; /** for karaoke, reserved otherwise */
uint8_t still_time;
uint8_t cell_cmd_nr;
dvd_time_t playback_time;
@@ -316,7 +316,7 @@ typedef struct {
uint8_t entry_id;
unsigned int block_mode : 2;
unsigned int block_type : 2;
- unsigned int unknown1 : 4;
+ unsigned int zero_1 : 4;
uint16_t ptl_id_mask;
uint32_t pgc_start_byte;
pgc_t *pgc;
@@ -578,7 +578,8 @@ typedef struct {
*/
typedef struct {
uint16_t lang_code;
- uint16_t unknown; /* 0x0001, title 1? disc 1? side 1? */
+ uint8_t zero_1;
+ uint8_t char_set; /* 0x00 reserved Unicode, 0x01 ISO 646, 0x10 JIS Roman & JIS Kanji, 0x11 ISO 8859-1, 0x12 Shift JIS Kanji */
uint32_t txtdt_start_byte; /* prt, rel start of vmg_txtdt_mgi */
txtdt_t *txtdt;
} ATTRIBUTE_PACKED txtdt_lu_t;
@@ -588,8 +589,9 @@ typedef struct {
* Text Data Manager Information. (Incomplete)
*/
typedef struct {
- char disc_name[14]; /* how many bytes?? */
- uint16_t nr_of_language_units; /* 32bit?? */
+ char disc_name[12];
+ uint16_t zero_1;
+ uint16_t nr_of_language_units;
uint32_t last_byte;
txtdt_lu_t *lu;
} ATTRIBUTE_PACKED txtdt_mgi_t;
diff --git a/src/ifo_print.c b/src/ifo_print.c
index 1b4acbd..4a7eee3 100644
--- a/src/ifo_print.c
+++ b/src/ifo_print.c
@@ -702,8 +702,8 @@ static void ifoPrint_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) {
printf("only still VOBUs ");
if(cell_playback[i].restricted)
printf("restricted cell ");
- if(cell_playback[i].unknown2)
- printf("Unknown 0x%x ", cell_playback[i].unknown2);
+ if(cell_playback[i].cell_type)
+ printf("cell type 0x%x ", cell_playback[i].cell_type);
if(cell_playback[i].still_time)
printf("still time %d ", cell_playback[i].still_time);
if(cell_playback[i].cell_cmd_nr)
diff --git a/src/ifo_read.c b/src/ifo_read.c
index 8d515fc..8b31d39 100644
--- a/src/ifo_read.c
+++ b/src/ifo_read.c
@@ -228,7 +228,7 @@ static void read_pgci_srp(pgci_srp_t *ps) {
ps->entry_id = dvdread_getbits(&state, 8);
ps->block_mode = dvdread_getbits(&state, 2);
ps->block_type = dvdread_getbits(&state, 2);
- ps->unknown1 = dvdread_getbits(&state, 4);
+ ps->zero_1 = dvdread_getbits(&state, 4);
ps->ptl_id_mask = dvdread_getbits(&state, 16);
ps->pgc_start_byte = dvdread_getbits(&state, 32);
}
@@ -245,9 +245,10 @@ static void read_cell_playback(cell_playback_t *cp) {
cp->interleaved = dvdread_getbits(&state, 1);
cp->stc_discontinuity = dvdread_getbits(&state, 1);
cp->seamless_angle = dvdread_getbits(&state, 1);
+ cp->zero_1 = dvdread_getbits(&state, 1);
cp->playback_mode = dvdread_getbits(&state, 1);
cp->restricted = dvdread_getbits(&state, 1);
- cp->unknown2 = dvdread_getbits(&state, 6);
+ cp->cell_type = dvdread_getbits(&state, 5);
cp->still_time = dvdread_getbits(&state, 8);
cp->cell_cmd_nr = dvdread_getbits(&state, 8);
@@ -1903,7 +1904,7 @@ static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
memcpy(&pgcit->pgci_srp[i], ptr, PGCI_SRP_SIZE);
ptr += PGCI_SRP_SIZE;
read_pgci_srp(&pgcit->pgci_srp[i]);
- CHECK_VALUE(pgcit->pgci_srp[i].unknown1 == 0);
+ CHECK_VALUE(pgcit->pgci_srp[i].zero_1 == 0);
}
free(data);
--
2.14.1
More information about the libdvdnav-devel
mailing list