[DVDnav-discuss] r1041 - in trunk/libdvdnav/src/dvdread: ifo_read.c ifo_types.h
nicodvb
subversion at mplayerhq.hu
Sun May 11 22:35:23 CEST 2008
Author: nicodvb
Date: Sun May 11 22:35:22 2008
New Revision: 1041
Log:
read_playback_type() finally removes the last conditional bitfield struct
Modified:
trunk/libdvdnav/src/dvdread/ifo_read.c
trunk/libdvdnav/src/dvdread/ifo_types.h
Modified: trunk/libdvdnav/src/dvdread/ifo_read.c
==============================================================================
--- trunk/libdvdnav/src/dvdread/ifo_read.c (original)
+++ trunk/libdvdnav/src/dvdread/ifo_read.c Sun May 11 22:35:22 2008
@@ -257,6 +257,22 @@ static void read_cell_playback(cell_play
cp->last_sector = dvdread_getbits(&state, 32);
}
+static void read_playback_type(playback_type_t *pt) {
+ getbits_state_t state;
+ uint8_t buf[sizeof(playback_type_t)];
+
+ memcpy(buf, pt, sizeof(playback_type_t));
+ if (!dvdread_getbits_init(&state, buf)) abort();
+ pt->zero_1 = dvdread_getbits(&state, 1);
+ pt->multi_or_random_pgc_title = dvdread_getbits(&state, 1);
+ pt->jlc_exists_in_cell_cmd = dvdread_getbits(&state, 1);
+ pt->jlc_exists_in_prepost_cmd = dvdread_getbits(&state, 1);
+ pt->jlc_exists_in_button_cmd = dvdread_getbits(&state, 1);
+ pt->jlc_exists_in_tt_dom = dvdread_getbits(&state, 1);
+ pt->chapter_search_or_play = dvdread_getbits(&state, 1);
+ pt->title_or_time_play = dvdread_getbits(&state, 1);
+}
+
ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
ifo_handle_t *ifofile;
@@ -1013,6 +1029,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofil
CHECK_VALUE((int)tt_srpt->nr_of_srpts * sizeof(title_info_t) <= info_length);
for(i = 0; i < tt_srpt->nr_of_srpts; i++) {
+ read_playback_type(&tt_srpt->title[i].pb_ty);
CHECK_VALUE(tt_srpt->title[i].pb_ty.zero_1 == 0);
CHECK_VALUE(tt_srpt->title[i].nr_of_angles != 0);
CHECK_VALUE(tt_srpt->title[i].nr_of_angles < 10);
Modified: trunk/libdvdnav/src/dvdread/ifo_types.h
==============================================================================
--- trunk/libdvdnav/src/dvdread/ifo_types.h (original)
+++ trunk/libdvdnav/src/dvdread/ifo_types.h Sun May 11 22:35:22 2008
@@ -433,7 +433,6 @@ typedef struct {
} ATTRIBUTE_PACKED vmgi_mat_t;
typedef struct {
-#ifdef WORDS_BIGENDIAN
unsigned int zero_1 : 1;
unsigned int multi_or_random_pgc_title : 1; /* 0: one sequential pgc title */
unsigned int jlc_exists_in_cell_cmd : 1;
@@ -442,16 +441,6 @@ typedef struct {
unsigned int jlc_exists_in_tt_dom : 1;
unsigned int chapter_search_or_play : 1; /* UOP 1 */
unsigned int title_or_time_play : 1; /* UOP 0 */
-#else
- unsigned char title_or_time_play : 1;
- unsigned char chapter_search_or_play : 1;
- unsigned char jlc_exists_in_tt_dom : 1;
- unsigned char jlc_exists_in_button_cmd : 1;
- unsigned char jlc_exists_in_prepost_cmd : 1;
- unsigned char jlc_exists_in_cell_cmd : 1;
- unsigned char multi_or_random_pgc_title : 1;
- unsigned char zero_1 : 1;
-#endif
} ATTRIBUTE_PACKED playback_type_t;
/**
More information about the DVDnav-discuss
mailing list