[MPlayer-cvslog] r25150 - in trunk/dvdread: ifo_print.c ifo_read.c ifo_types.h

nicodvb subversion at mplayerhq.hu
Fri Nov 23 22:09:06 CET 2007


Author: nicodvb
Date: Fri Nov 23 22:09:06 2007
New Revision: 25150

Log:
replaced audio_mapping_t and sub_mapping_t with uint16_t and uint32_t
respectively: conditional bitfields don't have the slightest chance
to be cross-platform, thus they are definitively broken.
Fixed the other files to use bitmasks instead of accessing the
previous bitfield members


Modified:
   trunk/dvdread/ifo_print.c
   trunk/dvdread/ifo_read.c
   trunk/dvdread/ifo_types.h

Modified: trunk/dvdread/ifo_print.c
==============================================================================
--- trunk/dvdread/ifo_print.c	(original)
+++ trunk/dvdread/ifo_print.c	Fri Nov 23 22:09:06 2007
@@ -797,14 +797,14 @@ void ifoPrint_PGC(pgc_t *pgc) {
   ifoPrint_USER_OPS(&pgc->prohibited_ops);
   
   for(i = 0; i < 8; i++) {
-    if(pgc->audio_control[i].present) { /* The 'is present' bit */
+    if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */
       printf("Audio stream %i control: %04x\n", 
              i, pgc->audio_control[i]);
     }
   }
   
   for(i = 0; i < 32; i++) {
-    if(pgc->subp_control[i].present) { /* The 'is present' bit */
+    if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */
       printf("Subpicture stream %2i control: %08x\n", 
              i, pgc->subp_control[i]);
     }

Modified: trunk/dvdread/ifo_read.c
==============================================================================
--- trunk/dvdread/ifo_read.c	(original)
+++ trunk/dvdread/ifo_read.c	Fri Nov 23 22:09:06 2007
@@ -763,10 +763,10 @@ static int ifoRead_PGC(ifo_handle_t *ifo
 
   /* verify time (look at print_time) */
   for(i = 0; i < 8; i++)
-    if(!pgc->audio_control[i].present)
+    if(!pgc->audio_control[i] & 0x8000)
       CHECK_ZERO(pgc->audio_control[i]);
   for(i = 0; i < 32; i++)
-    if(!pgc->subp_control[i].present)
+    if(!pgc->subp_control[i] & 0x80000000)
       CHECK_ZERO(pgc->subp_control[i]);
   
   /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */

Modified: trunk/dvdread/ifo_types.h
==============================================================================
--- trunk/dvdread/ifo_types.h	(original)
+++ trunk/dvdread/ifo_types.h	Fri Nov 23 22:09:06 2007
@@ -407,55 +407,6 @@ typedef struct {
 } ATTRIBUTE_PACKED user_ops_t;
 
 /**
- * Subpicture stream mapping for a subtitle
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
-  unsigned int present   : 1;
-  unsigned int zero1     : 2;
-  unsigned int s_4p3     : 5; /* stream for 4:3 on any display */
-
-  unsigned int zero2     : 3;
-  unsigned int s_wide    : 5; /* stream for 16:9 on widescreen display */
-
-  unsigned int zero3     : 3;
-  unsigned int s_lbox    : 5; /* stream for 16:9 on letterboxed 4:3 display */
-
-  unsigned int zero4     : 3;
-  unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */
-#else
-  unsigned int s_4p3     : 5; /* stream for 4:3 on any display */
-  unsigned int zero1     : 2;
-  unsigned int present   : 1;
-
-  unsigned int s_wide    : 5; /* stream for 16:9 on widescreen display */
-  unsigned int zero2     : 3;
-
-  unsigned int s_lbox    : 5; /* stream for 16:9 on letterboxed 4:3 display */
-  unsigned int zero3     : 3;
-
-  unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */
-  unsigned int zero4     : 3;
-#endif
-} ATTRIBUTE_PACKED subp_mapping_t;
-
-/**
- * Audio stream mapping for a soundtrack
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
-  unsigned int present : 1;
-  unsigned int zero1   : 4;
-  unsigned int s_audio : 3;
-#else
-  unsigned int s_audio : 3;
-  unsigned int zero1   : 4;
-  unsigned int present : 1;
-#endif
-  uint8_t zero2;
-} ATTRIBUTE_PACKED audio_mapping_t;
-
-/**
  * Program Chain Information.
  */
 typedef struct {
@@ -464,8 +415,8 @@ typedef struct {
   uint8_t  nr_of_cells;
   dvd_time_t playback_time;
   user_ops_t prohibited_ops;
-  audio_mapping_t audio_control[8];
-  subp_mapping_t subp_control[32];
+  uint16_t audio_control[8];
+  uint32_t subp_control[32];
   uint16_t next_pgc_nr;
   uint16_t prev_pgc_nr;
   uint16_t goup_pgc_nr;



More information about the MPlayer-cvslog mailing list