[MPlayer-dev-eng] [PATCH] rename internal libdvdread (dvdread->libdvdread)

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Sat Aug 30 00:57:01 CEST 2008


On Friday, 29 August 2008 at 23:35, Diego Biurrun wrote:
> On Fri, Aug 29, 2008 at 11:23:21PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > 
> > At the end of May, Nico split libdvdread from libdvdnav in our
> > libdvdnav fork. To avoid clashing with MPlayer's internal libdvdread,
> > the include dir was set to /usr/include/libdvdread instead of
> > /usr/include/dvdread and deviated from old upstream. The attached
> > patch (with the addition of svn mv dvdread libdvdread) renames
> > our internal libdvdread instead. I'm going to apply an appropriate
> > patch to our libdvdread fork to complement this change if this
> > is accepted.
> 
> I'm fine with this change, but Nico gets to decide.  I think it's
> preferable to keep the hacks local so to speak.
> 
> > --- Makefile	(revision 27490)
> > +++ Makefile	(working copy)
> > @@ -655,7 +655,7 @@
> >  
> >  DIRS =  . \
> > -        dvdread \
> > +        libdvdread \
> >          gui \
> 
> Please respect alphabetical order.

Fixed.

> > @@ -783,7 +783,7 @@
> >  
> > -dvdread/%.o dvdread/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DHAVE_CONFIG_H $(CFLAGS_LIBDVDCSS_DVDREAD)
> > +libdvdread/%.o libdvdread/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DHAVE_CONFIG_H $(CFLAGS_LIBDVDCSS_DVDREAD)
> >  libdvdcss/%.o libdvdcss/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\" $(CFLAGS_LIBDVDCSS)
> 
> same here

Fixed.

> Do not forget to update the Copyright file with the new location and

Fixed, updated patch attached.

> also update the local changes file.

Hm. That is a bit problematic, after all our local changes don't correspond
to that diff. I'm attaching the diff between vanilla libdvdread-0.9.7
and MPlayer internal (including my change).

Regards,
R.

-- 
MPlayer http://mplayerhq.hu | Livna http://rpm.livna.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- dvdread/bswap.h	2006-06-06 22:03:37.000000000 +0200
+++ libdvdread/bswap.h	2008-08-29 18:24:03.000000000 +0200
@@ -1,126 +1,16 @@
-/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
-#ifndef BSWAP_H_INCLUDED
-#define BSWAP_H_INCLUDED
+#ifndef DVDREAD_BSWAP_H
+#define DVDREAD_BSWAP_H
 
-/*
- * Copyright (C) 2000, 2001 Billy Biggs <vektor at dumbterm.net>,
- *                          H?kan Hjort <d95hjort at dtek.chalmers.se>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#if defined(WORDS_BIGENDIAN)
-/* All bigendian systems are fine, just ignore the swaps. */  
-#define B2N_16(x) (void)(x)
-#define B2N_32(x) (void)(x)
-#define B2N_64(x) (void)(x)
+#include "libavutil/bswap.h"
 
+#ifdef WORDS_BIGENDIAN
+#define B2N_16(x)
+#define B2N_32(x)
+#define B2N_64(x)
 #else 
-
-/* For __FreeBSD_version */
-#if defined(HAVE_SYS_PARAM_H)
-#include <sys/param.h>
-#endif
-
-#if defined(__linux__)
-#include <byteswap.h>
 #define B2N_16(x) x = bswap_16(x)
 #define B2N_32(x) x = bswap_32(x)
 #define B2N_64(x) x = bswap_64(x)
-
-#elif defined(__NetBSD__)
-#include <sys/endian.h>
-#define B2N_16(x) BE16TOH(x)
-#define B2N_32(x) BE32TOH(x)
-#define B2N_64(x) BE64TOH(x)
-
-#elif defined(__OpenBSD__)
-#include <sys/endian.h>
-#define B2N_16(x) x = swap16(x)
-#define B2N_32(x) x = swap32(x)
-#define B2N_64(x) x = swap64(x)
-
-#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000
-#include <sys/endian.h>
-#define B2N_16(x) x = be16toh(x)
-#define B2N_32(x) x = be32toh(x)
-#if __FreeBSD_version >= 500000
-#define B2N_64(x) x = be64toh(x)
-#else
-#define B2N_64(x)                               \
-  x = ((((x) & 0xff00000000000000) >> 56) |     \
-       (((x) & 0x00ff000000000000) >> 40) |     \
-       (((x) & 0x0000ff0000000000) >> 24) |     \
-       (((x) & 0x000000ff00000000) >>  8) |     \
-       (((x) & 0x00000000ff000000) <<  8) |     \
-       (((x) & 0x0000000000ff0000) << 24) |     \
-       (((x) & 0x000000000000ff00) << 40) |     \
-       (((x) & 0x00000000000000ff) << 56))
-#endif /* _FreeBSD_version >= 500000 */
-
-#elif defined(__DragonFly__)
-#include <sys/endian.h>
-#define B2N_16(x) x = be16toh(x)
-#define B2N_32(x) x = be32toh(x)
-#define B2N_64(x) x = be64toh(x)
-
-
-#elif defined(__APPLE__) || defined(__DARWIN__)
-#include <libkern/OSByteOrder.h>
-#define B2N_16(x) x = OSSwapBigToHostConstInt16(x)
-#define B2N_32(x) x = OSSwapBigToHostConstInt32(x)
-#define B2N_64(x) x = OSSwapBigToHostConstInt64(x)
-
-#else
-#if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX)
-/* These systems don't have swap macros */
-#else
-/* If there isn't a header provided with your system with this functionality
- * add the relevant || define( ) to the list above.
- */
-#warning "You should add endian swap macros for your system"
 #endif
 
-/* This is a slow but portable implementation, it has multiple evaluation 
- * problems so beware.
- * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such 
- * functionality! 
- */
-
-#define B2N_16(x)                               \
-  x = ((((x) & 0xff00) >> 8) |                  \
-       (((x) & 0x00ff) << 8))
-#define B2N_32(x)                               \
-  x = ((((x) & 0xff000000) >> 24) |             \
-       (((x) & 0x00ff0000) >>  8) |             \
-       (((x) & 0x0000ff00) <<  8) |             \
-       (((x) & 0x000000ff) << 24))
-#define B2N_64(x)                               \
-  x = ((((x) & 0xff00000000000000) >> 56) |     \
-       (((x) & 0x00ff000000000000) >> 40) |     \
-       (((x) & 0x0000ff0000000000) >> 24) |     \
-       (((x) & 0x000000ff00000000) >>  8) |     \
-       (((x) & 0x00000000ff000000) <<  8) |     \
-       (((x) & 0x0000000000ff0000) << 24) |     \
-       (((x) & 0x000000000000ff00) << 40) |     \
-       (((x) & 0x00000000000000ff) << 56))
-
-
-
 #endif
-
-#endif /* WORDS_BIGENDIAN */
-
-#endif /* BSWAP_H_INCLUDED */
--- dvdread/cmd_print.h	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/cmd_print.h	2008-08-30 00:37:49.000000000 +0200
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/ifo_types.h>
+#include <libdvdread/ifo_types.h>
 
 /**
  * Pretty printing of the DVD commands (vm instructions).
--- dvdread/dvd_reader.c	2006-10-06 09:58:03.000000000 +0200
+++ libdvdread/dvd_reader.c	2008-08-30 00:36:56.000000000 +0200
@@ -4,6 +4,10 @@
  *                                H?kan Hjort <d95hjort at dtek.chalmers.se>,
  *                                Bj?rn Englund <d4bjorn at dtek.chalmers.se>
  *
+ * Modified for use with MPlayer, changes contained in libdvdread_changes.diff.
+ * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
+ * $Id: dvd_reader.c 24115 2007-08-21 17:12:30Z diego $
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or (at
@@ -39,9 +43,11 @@
 
 #if defined(__sun)
 #include <sys/mnttab.h>
+#elif defined(hpux)
+#include </usr/conf/h/mnttab.h>
 #elif defined(SYS_BSD)
 #include <fstab.h>
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__CYGWIN__)
 #include <mntent.h>
 #endif
 
@@ -52,7 +58,7 @@
 
 #include "dvdread_internal.h"
 
-#define DEFAULT_UDF_CACHE_LEVEL 1
+#define DEFAULT_UDF_CACHE_LEVEL 0
 
 struct dvd_reader_s {
   /* Basic information. */
@@ -183,18 +189,6 @@
   dev->align = align;
 }
 
-#ifdef WIN32 /* replacement gettimeofday implementation */
-#include <sys/timeb.h>
-static int gettimeofday( struct timeval *tv, void *tz )
-{
-  struct timeb t;
-  ftime( &t );
-  tv->tv_sec = t.time;
-  tv->tv_usec = t.millitm * 1000;
-  return 0;
-}
-#endif
-
 
 /* Loop over all titles and call dvdcss_title to crack the keys. */
 static int initAllCSSKeys( dvd_reader_t *dvd )
@@ -494,7 +488,7 @@
     char *path_copy;
 #if defined(SYS_BSD)
     struct fstab* fe;
-#elif defined(__sun) || defined(__linux__)
+#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__)
     FILE *mntfile;
 #endif
 
@@ -598,7 +592,7 @@
       }
       fclose( mntfile );
     }
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__CYGWIN__)
     mntfile = fopen( MOUNTED, "r" );
     if( mntfile ) {
       struct mntent *me;
@@ -623,6 +617,9 @@
       }
       fclose( mntfile );
     }
+#elif defined(__MINGW32__)
+    dev_name = strdup(path);
+    auth_drive = DVDOpenImageFile( path, have_css );
 #endif
     if( !dev_name ) {
       if(verbose >= 1) {
@@ -841,8 +838,8 @@
   }
     
   if( dvd->css_state == 1 /* Need key init */ ) {
-    initAllCSSKeys( dvd );
-    dvd->css_state = 2;
+//    initAllCSSKeys( dvd );
+//    dvd->css_state = 2;
   }
   /*    
         if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) {
--- dvdread/dvdread_internal.h	2005-09-12 21:42:12.000000000 +0200
+++ libdvdread/dvdread_internal.h	2008-08-30 00:36:56.000000000 +0200
@@ -3,12 +3,7 @@
 #define DVDREAD_INTERNAL_H
 
 
-#define CHECK_VALUE(arg)                                                \
-  if(!(arg)) {                                                          \
-    fprintf(stderr, "\n*** libdvdread: CHECK_VALUE failed in %s:%i ***" \
-            "\n*** for %s ***\n\n",                                     \
-            __FILE__, __LINE__, # arg );                                \
-  }
+#define CHECK_VALUE(arg)
 
 
 int get_verbose(void);
--- dvdread/ifo_print.c	2005-09-15 18:54:29.000000000 +0200
+++ libdvdread/ifo_print.c	2007-11-23 22:09:06.000000000 +0100
@@ -4,6 +4,10 @@
  *               Bj?rn Englund <d4bjorn at dtek.chalmers.se>, 
  *               H?kan Hjort <d95hjort at dtek.chalmers.se>
  *
+ * Modified for use with MPlayer, changes contained in libdvdread_changes.diff.
+ * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
+ * $Id: ifo_print.c 25150 2007-11-23 21:09:06Z nicodvb $
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
--- dvdread/ifo_print.h	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/ifo_print.h	2008-08-30 00:38:14.000000000 +0200
@@ -21,8 +21,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/ifo_types.h>
-#include <dvdread/dvd_reader.h>
+#include <libdvdread/ifo_types.h>
+#include <libdvdread/dvd_reader.h>
 
 #ifdef __cplusplus
 extern "C" {
--- dvdread/ifo_read.c	2006-01-22 13:19:19.000000000 +0100
+++ libdvdread/ifo_read.c	2007-11-25 22:45:35.000000000 +0100
@@ -4,6 +4,10 @@
  *               Bj?rn Englund <d4bjorn at dtek.chalmers.se>, 
  *               H?kan Hjort <d95hjort at dtek.chalmers.se>
  *
+ * Modified for use with MPlayer, changes contained in libdvdread_changes.diff.
+ * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
+ * $Id: ifo_read.c 25161 2007-11-25 21:45:35Z nicodvb $
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -110,7 +114,7 @@
 ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
   ifo_handle_t *ifofile;
 
-  ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
+  ifofile = malloc(sizeof(ifo_handle_t));
   if(!ifofile)
     return NULL;
 
@@ -240,7 +244,7 @@
 ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd) {
   ifo_handle_t *ifofile;
 
-  ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
+  ifofile = malloc(sizeof(ifo_handle_t));
   if(!ifofile)
     return NULL;
 
@@ -292,7 +296,7 @@
 ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) {
   ifo_handle_t *ifofile;
   
-  ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
+  ifofile = malloc(sizeof(ifo_handle_t));
   if(!ifofile)
     return NULL;
 
@@ -382,7 +386,7 @@
 static int ifoRead_VMG(ifo_handle_t *ifofile) {
   vmgi_mat_t *vmgi_mat;
 
-  vmgi_mat = (vmgi_mat_t *)malloc(sizeof(vmgi_mat_t));
+  vmgi_mat = malloc(sizeof(vmgi_mat_t));
   if(!vmgi_mat)
     return 0;
 
@@ -473,7 +477,7 @@
   vtsi_mat_t *vtsi_mat;
   int i;
 
-  vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t));
+  vtsi_mat = malloc(sizeof(vtsi_mat_t));
   if(!vtsi_mat)
     return 0;
   
@@ -606,7 +610,7 @@
 
   if(cmd_tbl->nr_of_pre != 0) {
     unsigned int pre_cmds_size  = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE;
-    cmd_tbl->pre_cmds = (vm_cmd_t *)malloc(pre_cmds_size);
+    cmd_tbl->pre_cmds = malloc(pre_cmds_size);
     if(!cmd_tbl->pre_cmds)
       return 0;
 
@@ -618,7 +622,7 @@
 
   if(cmd_tbl->nr_of_post != 0) {
     unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE;
-    cmd_tbl->post_cmds = (vm_cmd_t *)malloc(post_cmds_size);
+    cmd_tbl->post_cmds = malloc(post_cmds_size);
     if(!cmd_tbl->post_cmds) {
       if(cmd_tbl->pre_cmds) 
         free(cmd_tbl->pre_cmds);
@@ -634,7 +638,7 @@
 
   if(cmd_tbl->nr_of_cell != 0) {
     unsigned int cell_cmds_size = cmd_tbl->nr_of_cell * COMMAND_DATA_SIZE;
-    cmd_tbl->cell_cmds = (vm_cmd_t *)malloc(cell_cmds_size);
+    cmd_tbl->cell_cmds = malloc(cell_cmds_size);
     if(!cmd_tbl->cell_cmds) {
       if(cmd_tbl->pre_cmds)
         free(cmd_tbl->pre_cmds);
@@ -763,10 +767,10 @@
 
   /* verify time (look at print_time) */
   for(i = 0; i < 8; i++)
-    if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */
+    if(!pgc->audio_control[i] & 0x8000)
       CHECK_ZERO(pgc->audio_control[i]);
   for(i = 0; i < 32; i++)
-    if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */
+    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 */
@@ -880,7 +884,7 @@
   if(ifofile->vmgi_mat->first_play_pgc == 0)
     return 1;
   
-  ifofile->first_play_pgc = (pgc_t *)malloc(sizeof(pgc_t));
+  ifofile->first_play_pgc = malloc(sizeof(pgc_t));
   if(!ifofile->first_play_pgc)
     return 0;
   
@@ -934,7 +938,7 @@
   if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->tt_srpt * DVD_BLOCK_LEN))
     return 0;
 
-  tt_srpt = (tt_srpt_t *)malloc(sizeof(tt_srpt_t));
+  tt_srpt = malloc(sizeof(tt_srpt_t));
   if(!tt_srpt)
     return 0;
 
@@ -953,7 +957,7 @@
   
   info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE;
 
-  tt_srpt->title = (title_info_t *)malloc(info_length); 
+  tt_srpt->title = malloc(info_length);
   if(!tt_srpt->title) {
     free(tt_srpt);
     ifofile->tt_srpt = 0;
@@ -1040,7 +1044,7 @@
                    ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN))
     return 0;
 
-  vts_ptt_srpt = (vts_ptt_srpt_t *)malloc(sizeof(vts_ptt_srpt_t));
+  vts_ptt_srpt = malloc(sizeof(vts_ptt_srpt_t));
   if(!vts_ptt_srpt)
     return 0;
 
@@ -1063,7 +1067,7 @@
   
   info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE;
   
-  data = (uint32_t *)malloc(info_length); 
+  data = malloc(info_length);
   if(!data) {
     free(vts_ptt_srpt);
     ifofile->vts_ptt_srpt = 0;
@@ -1183,7 +1187,7 @@
   if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN))
     return 0;
 
-  ptl_mait = (ptl_mait_t *)malloc(sizeof(ptl_mait_t));
+  ptl_mait = malloc(sizeof(ptl_mait_t));
   if(!ptl_mait)
     return 0;
 
@@ -1207,7 +1211,7 @@
               <= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE);
   
   info_length = ptl_mait->nr_of_countries * sizeof(ptl_mait_country_t);
-  ptl_mait->countries = (ptl_mait_country_t *)malloc(info_length);
+  ptl_mait->countries = malloc(info_length);
   if(!ptl_mait->countries) {
     free(ptl_mait);
     ifofile->ptl_mait = 0;
@@ -1252,7 +1256,7 @@
       return 0;
     }
     info_length = (ptl_mait->nr_of_vtss + 1) * sizeof(pf_level_t);
-    pf_temp = (uint16_t *)malloc(info_length);
+    pf_temp = malloc(info_length);
     if(!pf_temp) {
       for(j = 0; j < i ; j++) {
         free(ptl_mait->countries[j].pf_ptl_mai);
@@ -1276,7 +1280,7 @@
     for (j = 0; j < ((ptl_mait->nr_of_vtss + 1) * 8); j++) {
       B2N_16(pf_temp[j]);
     }
-    ptl_mait->countries[i].pf_ptl_mai = (pf_level_t *)malloc(info_length);
+    ptl_mait->countries[i].pf_ptl_mai = malloc(info_length);
     if(!ptl_mait->countries[i].pf_ptl_mai) {
       free(pf_temp);
       for(j = 0; j < i ; j++) {
@@ -1340,7 +1344,7 @@
   if(!DVDFileSeek_(ifofile->file, offset)) 
     return 0;
   
-  vts_tmapt = (vts_tmapt_t *)malloc(sizeof(vts_tmapt_t));
+  vts_tmapt = malloc(sizeof(vts_tmapt_t));
   if(!vts_tmapt)
     return 0;
   
@@ -1362,7 +1366,7 @@
   
   info_length = vts_tmapt->nr_of_tmaps * 4;
   
-  vts_tmap_srp = (uint32_t *)malloc(info_length);
+  vts_tmap_srp = malloc(info_length);
   if(!vts_tmap_srp) {
     free(vts_tmapt);
     ifofile->vts_tmapt = NULL;
@@ -1388,7 +1392,7 @@
   
   info_length = vts_tmapt->nr_of_tmaps * sizeof(vts_tmap_t);
   
-  vts_tmapt->tmap = (vts_tmap_t *)malloc(info_length);
+  vts_tmapt->tmap = malloc(info_length);
   if(!vts_tmapt->tmap) {
     free(vts_tmap_srp);
     free(vts_tmapt);
@@ -1422,7 +1426,7 @@
     
     info_length = vts_tmapt->tmap[i].nr_of_entries * sizeof(map_ent_t);
     
-    vts_tmapt->tmap[i].map_ent = (map_ent_t *)malloc(info_length);
+    vts_tmapt->tmap[i].map_ent = malloc(info_length);
     if(!vts_tmapt->tmap[i].map_ent) {
       ifoFree_VTS_TMAPT(ifofile);
       return 0;
@@ -1472,7 +1476,7 @@
   if(ifofile->vtsi_mat->vts_c_adt == 0) /* mandatory */
     return 0;
 
-  ifofile->vts_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
+  ifofile->vts_c_adt = malloc(sizeof(c_adt_t));
   if(!ifofile->vts_c_adt)
     return 0;
 
@@ -1504,7 +1508,7 @@
     return 0;
   }
   
-  ifofile->menu_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
+  ifofile->menu_c_adt = malloc(sizeof(c_adt_t));
   if(!ifofile->menu_c_adt)
     return 0;
 
@@ -1548,7 +1552,7 @@
     c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t);
   }
   
-  c_adt->cell_adr_table = (cell_adr_t *)malloc(info_length);
+  c_adt->cell_adr_table = malloc(info_length);
   if(!c_adt->cell_adr_table)
     return 0;
 
@@ -1608,7 +1612,7 @@
   if(ifofile->vtsi_mat->vts_vobu_admap == 0) /* mandatory */
     return 0;
   
-  ifofile->vts_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
+  ifofile->vts_vobu_admap = malloc(sizeof(vobu_admap_t));
   if(!ifofile->vts_vobu_admap)
     return 0;
 
@@ -1640,7 +1644,7 @@
     return 0;
   }
   
-  ifofile->menu_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
+  ifofile->menu_vobu_admap = malloc(sizeof(vobu_admap_t));
   if(!ifofile->menu_vobu_admap)
     return 0;
   
@@ -1673,7 +1677,7 @@
      Titles with a VOBS that has no VOBUs. */
   CHECK_VALUE(info_length % sizeof(uint32_t) == 0);
   
-  vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length); 
+  vobu_admap->vobu_start_sectors = malloc(info_length);
   if(!vobu_admap->vobu_start_sectors) {
     return 0;
   }
@@ -1725,7 +1729,7 @@
   if(ifofile->vtsi_mat->vts_pgcit == 0) /* mandatory */
     return 0;
   
-  ifofile->vts_pgcit = (pgcit_t *)malloc(sizeof(pgcit_t));
+  ifofile->vts_pgcit = malloc(sizeof(pgcit_t));
   if(!ifofile->vts_pgcit)
     return 0;
 
@@ -1860,7 +1864,7 @@
     return 0;
   }
   
-  ifofile->pgci_ut = (pgci_ut_t *)malloc(sizeof(pgci_ut_t));
+  ifofile->pgci_ut = malloc(sizeof(pgci_ut_t));
   if(!ifofile->pgci_ut)
     return 0;
   
@@ -2050,7 +2054,7 @@
   if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
     return 0;
 
-  vts_atrt = (vts_atrt_t *)malloc(sizeof(vts_atrt_t));
+  vts_atrt = malloc(sizeof(vts_atrt_t));
   if(!vts_atrt)
     return 0;
 
@@ -2072,7 +2076,7 @@
               VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
 
   info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t);
-  data = (uint32_t *)malloc(info_length);
+  data = malloc(info_length);
   if(!data) {
     free(vts_atrt);
     ifofile->vts_atrt = 0;
@@ -2094,7 +2098,7 @@
   }
   
   info_length = vts_atrt->nr_of_vtss * sizeof(vts_attributes_t);
-  vts_atrt->vts = (vts_attributes_t *)malloc(info_length);
+  vts_atrt->vts = malloc(info_length);
   if(!vts_atrt->vts) {
     free(data);
     free(vts_atrt);
@@ -2150,7 +2154,7 @@
                    ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN))
     return 0;
   
-  txtdt_mgi = (txtdt_mgi_t *)malloc(sizeof(txtdt_mgi_t));
+  txtdt_mgi = malloc(sizeof(txtdt_mgi_t));
   if(!txtdt_mgi) {
     return 0;
   }
--- dvdread/ifo_read.h	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/ifo_read.h	2008-08-30 00:38:02.000000000 +0200
@@ -21,8 +21,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/ifo_types.h>
-#include <dvdread/dvd_reader.h>
+#include <libdvdread/ifo_types.h>
+#include <libdvdread/dvd_reader.h>
 
 #ifdef __cplusplus
 extern "C" {
--- dvdread/ifo_types.h	2006-03-02 18:25:43.000000000 +0100
+++ libdvdread/ifo_types.h	2008-08-30 00:37:55.000000000 +0200
@@ -6,6 +6,10 @@
  * Copyright (C) 2000, 2001 Bj?rn Englund <d4bjorn at dtek.chalmers.se>,
  *                          H?kan Hjort <d95hjort at dtek.chalmers.se>
  *
+ * Modified for use with MPlayer, changes contained in libdvdread_changes.diff.
+ * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
+ * $Id: ifo_types.h 25150 2007-11-23 21:09:06Z nicodvb $
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -21,7 +25,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/dvd_reader.h>
+#include <libdvdread/dvd_reader.h>
 
 #if defined(__BEOS__)
 #if !defined(_INTTYPES_H_) && !defined(_INTTYPES_H) && !defined(_STDINT_H_) && !defined(_STDINT_H)
@@ -411,8 +415,8 @@
   uint8_t  nr_of_cells;
   dvd_time_t playback_time;
   user_ops_t prohibited_ops;
-  uint16_t audio_control[8]; /* New type? */
-  uint32_t subp_control[32]; /* New type? */
+  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;
--- dvdread/nav_print.h	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/nav_print.h	2008-08-30 00:38:19.000000000 +0200
@@ -21,7 +21,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/nav_types.h>
+#include <libdvdread/nav_types.h>
 
 /**
  * Pretty printing of the NAV packets, PCI and DSI structs.
--- dvdread/nav_read.c	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/nav_read.c	2008-08-29 18:24:02.000000000 +0200
@@ -32,62 +32,176 @@
 #include "nav_read.h"
 #include "dvdread_internal.h"
 
-void navRead_PCI(pci_t *pci, unsigned char *buffer) {
-  int i, j;
+typedef struct {
+  uint8_t *start;
+  uint32_t byte_position;
+  uint32_t bit_position;
+  uint8_t byte;
+} getbits_state_t;
+
+static int getbits_init(getbits_state_t *state, uint8_t *start) {
+  if ((state == NULL) || (start == NULL)) return 0;
+  state->start = start;
+  state->bit_position = 0;
+  state->byte_position = 0;
+  state->byte = start[0];
+  return 1;
+}
+
+/* Non-optimized getbits. */
+/* This can easily be optimized for particular platforms. */
+static uint32_t getbits(getbits_state_t *state, uint32_t number_of_bits) {
+  uint32_t result=0;
+  uint8_t byte=0;
+  if (number_of_bits > 32) {
+    printf("Number of bits > 32 in getbits\n");
+    abort();
+  }
+
+  if ((state->bit_position) > 0) {  /* Last getbits left us in the middle of a byte. */
+    if (number_of_bits > (8-state->bit_position)) { /* this getbits will span 2 or more bytes. */
+      byte = state->byte;
+      byte = byte >> (state->bit_position);
+      result = byte;
+      number_of_bits -= (8-state->bit_position);
+      state->bit_position = 0;
+      state->byte_position++;
+      state->byte = state->start[state->byte_position];
+    } else {
+      byte=state->byte;
+      state->byte = state->byte << number_of_bits;
+      byte = byte >> (8 - number_of_bits);
+      result = byte;
+      state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 8 */
+      if (state->bit_position == 8) {
+        state->bit_position = 0;
+        state->byte_position++;
+        state->byte = state->start[state->byte_position];
+      }
+      number_of_bits = 0;
+    }
+  }
+  if ((state->bit_position) == 0) {
+    while (number_of_bits > 7) {
+      result = (result << 8) + state->byte;
+      state->byte_position++;
+      state->byte = state->start[state->byte_position];
+      number_of_bits -= 8;
+    }
+    if (number_of_bits > 0) { /* number_of_bits < 8 */
+      byte = state->byte;
+      state->byte = state->byte << number_of_bits;
+      state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 7 */
+      byte = byte >> (8 - number_of_bits);
+      result = (result << number_of_bits) + byte;
+      number_of_bits = 0;
+    }
+  }
 
-  CHECK_VALUE(sizeof(pci_t) == PCI_BYTES - 1); // -1 for substream id
+  return result;
+}
   
-  memcpy(pci, buffer, sizeof(pci_t));
 
-  /* Endian conversions  */
+void navRead_PCI(pci_t *pci, unsigned char *buffer) {
+  int i, j;
+  getbits_state_t state;
+  if (!getbits_init(&state, buffer)) abort(); /* Passed NULL pointers */
 
   /* pci pci_gi */
-  B2N_32(pci->pci_gi.nv_pck_lbn);
-  B2N_16(pci->pci_gi.vobu_cat);
-  B2N_32(pci->pci_gi.vobu_s_ptm);
-  B2N_32(pci->pci_gi.vobu_e_ptm);
-  B2N_32(pci->pci_gi.vobu_se_e_ptm);
+  pci->pci_gi.nv_pck_lbn = getbits(&state, 32 );
+  pci->pci_gi.vobu_cat = getbits(&state, 16 );
+  pci->pci_gi.zero1 = getbits(&state, 16 );
+  pci->pci_gi.vobu_uop_ctl.zero = getbits(&state, 7 );
+  pci->pci_gi.vobu_uop_ctl.video_pres_mode_change         = getbits(&state, 1 );
+
+  pci->pci_gi.vobu_uop_ctl.karaoke_audio_pres_mode_change = getbits(&state, 1 ); 
+  pci->pci_gi.vobu_uop_ctl.angle_change                   = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.subpic_stream_change           = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.audio_stream_change            = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.pause_on                       = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.still_off                      = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.button_select_or_activate      = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.resume                         = getbits(&state, 1 );
+
+  pci->pci_gi.vobu_uop_ctl.chapter_menu_call              = getbits(&state, 1 ); 
+  pci->pci_gi.vobu_uop_ctl.angle_menu_call                = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.audio_menu_call                = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.subpic_menu_call               = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.root_menu_call                 = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.title_menu_call                = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.backward_scan                  = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.forward_scan                   = getbits(&state, 1 );
+
+  pci->pci_gi.vobu_uop_ctl.next_pg_search                 = getbits(&state, 1 ); 
+  pci->pci_gi.vobu_uop_ctl.prev_or_top_pg_search          = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.time_or_chapter_search         = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.go_up                          = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.stop                           = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.title_play                     = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.chapter_search_or_play         = getbits(&state, 1 );
+  pci->pci_gi.vobu_uop_ctl.title_or_time_play             = getbits(&state, 1 );
+  pci->pci_gi.vobu_s_ptm = getbits(&state, 32 ); 
+  pci->pci_gi.vobu_e_ptm = getbits(&state, 32 ); 
+  pci->pci_gi.vobu_se_e_ptm = getbits(&state, 32 ); 
+  pci->pci_gi.e_eltm.hour   = getbits(&state, 8 );
+  pci->pci_gi.e_eltm.minute = getbits(&state, 8 );
+  pci->pci_gi.e_eltm.second = getbits(&state, 8 );
+  pci->pci_gi.e_eltm.frame_u = getbits(&state, 8 );
+  for(i = 0; i < 32; i++)
+    pci->pci_gi.vobu_isrc[i] = getbits(&state, 8 );
 
   /* pci nsml_agli */
   for(i = 0; i < 9; i++)
-    B2N_32(pci->nsml_agli.nsml_agl_dsta[i]);
+    pci->nsml_agli.nsml_agl_dsta[i] = getbits(&state, 32 );
 
   /* pci hli hli_gi */
-  B2N_16(pci->hli.hl_gi.hli_ss);
-  B2N_32(pci->hli.hl_gi.hli_s_ptm);
-  B2N_32(pci->hli.hl_gi.hli_e_ptm);
-  B2N_32(pci->hli.hl_gi.btn_se_e_ptm);
+  pci->hli.hl_gi.hli_ss = getbits(&state, 16 );
+  pci->hli.hl_gi.hli_s_ptm = getbits(&state, 32 ); 
+  pci->hli.hl_gi.hli_e_ptm = getbits(&state, 32 );
+  pci->hli.hl_gi.btn_se_e_ptm = getbits(&state, 32 );
+  pci->hli.hl_gi.zero1 = getbits(&state, 2 );
+  pci->hli.hl_gi.btngr_ns = getbits(&state, 2 );
+  pci->hli.hl_gi.zero2 = getbits(&state, 1 );
+  pci->hli.hl_gi.btngr1_dsp_ty = getbits(&state, 3 );
+  pci->hli.hl_gi.zero3 = getbits(&state, 1 );
+  pci->hli.hl_gi.btngr2_dsp_ty = getbits(&state, 3 );
+  pci->hli.hl_gi.zero4 = getbits(&state, 1 );
+  pci->hli.hl_gi.btngr3_dsp_ty = getbits(&state, 3 );
+  pci->hli.hl_gi.btn_ofn = getbits(&state, 8 );
+  pci->hli.hl_gi.btn_ns = getbits(&state, 8 );
+  pci->hli.hl_gi.nsl_btn_ns = getbits(&state, 8 ); 
+  pci->hli.hl_gi.zero5 = getbits(&state, 8 );
+  pci->hli.hl_gi.fosl_btnn = getbits(&state, 8 );
+  pci->hli.hl_gi.foac_btnn = getbits(&state, 8 );
 
   /* pci hli btn_colit */
   for(i = 0; i < 3; i++)
     for(j = 0; j < 2; j++)
-      B2N_32(pci->hli.btn_colit.btn_coli[i][j]);
-
-  /* NOTE: I've had to change the structure from the disk layout to get
-   * the packing to work with Sun's Forte C compiler. */
+      pci->hli.btn_colit.btn_coli[i][j] = getbits(&state, 32 ); 
   
   /* pci hli btni */
   for(i = 0; i < 36; i++) {
-    char tmp[sizeof(pci->hli.btnit[i])], swap;
-    memcpy(tmp, &(pci->hli.btnit[i]), sizeof(pci->hli.btnit[i]));
-    /* Byte 4 to 7 are 'rotated' was: ABCD EFGH IJ is: ABCG DEFH IJ */
-    swap   = tmp[6]; 
-    tmp[6] = tmp[5];
-    tmp[5] = tmp[4];
-    tmp[4] = tmp[3];
-    tmp[3] = swap;
-    
-    /* Then there are the two B2N_24(..) calls */
-#ifndef WORDS_BIGENDIAN
-    swap = tmp[0];
-    tmp[0] = tmp[2];
-    tmp[2] = swap;
-    
-    swap = tmp[4];
-    tmp[4] = tmp[6];
-    tmp[6] = swap;
-#endif
-    memcpy(&(pci->hli.btnit[i]), tmp, sizeof(pci->hli.btnit[i]));
+    pci->hli.btnit[i].btn_coln = getbits(&state, 2 );
+    pci->hli.btnit[i].x_start = getbits(&state, 10 );
+    pci->hli.btnit[i].zero1 = getbits(&state, 2 );
+    pci->hli.btnit[i].x_end = getbits(&state, 10 );
+
+    pci->hli.btnit[i].auto_action_mode = getbits(&state, 2 );
+    pci->hli.btnit[i].y_start = getbits(&state, 10 );
+    pci->hli.btnit[i].zero2 = getbits(&state, 2 );
+    pci->hli.btnit[i].y_end = getbits(&state, 10 );
+
+    pci->hli.btnit[i].zero3 = getbits(&state, 2 );
+    pci->hli.btnit[i].up = getbits(&state, 6 );
+    pci->hli.btnit[i].zero4 = getbits(&state, 2 );
+    pci->hli.btnit[i].down = getbits(&state, 6 );
+    pci->hli.btnit[i].zero5 = getbits(&state, 2 );
+    pci->hli.btnit[i].left = getbits(&state, 6 );
+    pci->hli.btnit[i].zero6 = getbits(&state, 2 );
+    pci->hli.btnit[i].right = getbits(&state, 6 );
+    /* pci vm_cmd */
+    for(j = 0; j < 8; j++)
+      pci->hli.btnit[i].cmd.bytes[j] = getbits(&state, 8 );
   }
 
 
@@ -154,51 +268,59 @@
 
 void navRead_DSI(dsi_t *dsi, unsigned char *buffer) {
   int i;
-
-  CHECK_VALUE(sizeof(dsi_t) == DSI_BYTES - 1); // -1 for substream id
-  
-  memcpy(dsi, buffer, sizeof(dsi_t));
-
-  /* Endian conversions */
+  getbits_state_t state;
+  if (!getbits_init(&state, buffer)) abort(); /* Passed NULL pointers */
 
   /* dsi dsi gi */
-  B2N_32(dsi->dsi_gi.nv_pck_scr);
-  B2N_32(dsi->dsi_gi.nv_pck_lbn);
-  B2N_32(dsi->dsi_gi.vobu_ea);
-  B2N_32(dsi->dsi_gi.vobu_1stref_ea);
-  B2N_32(dsi->dsi_gi.vobu_2ndref_ea);
-  B2N_32(dsi->dsi_gi.vobu_3rdref_ea);
-  B2N_16(dsi->dsi_gi.vobu_vob_idn);
+  dsi->dsi_gi.nv_pck_scr = getbits(&state, 32 );
+  dsi->dsi_gi.nv_pck_lbn = getbits(&state, 32 );
+  dsi->dsi_gi.vobu_ea = getbits(&state, 32 );
+  dsi->dsi_gi.vobu_1stref_ea = getbits(&state, 32 );
+  dsi->dsi_gi.vobu_2ndref_ea = getbits(&state, 32 );
+  dsi->dsi_gi.vobu_3rdref_ea = getbits(&state, 32 );
+  dsi->dsi_gi.vobu_vob_idn = getbits(&state, 16 );
+  dsi->dsi_gi.zero1 = getbits(&state, 8 );
+  dsi->dsi_gi.vobu_c_idn = getbits(&state, 8 );
+  dsi->dsi_gi.c_eltm.hour   = getbits(&state, 8 );
+  dsi->dsi_gi.c_eltm.minute = getbits(&state, 8 );
+  dsi->dsi_gi.c_eltm.second = getbits(&state, 8 );
+  dsi->dsi_gi.c_eltm.frame_u = getbits(&state, 8 );
 
   /* dsi sml pbi */
-  B2N_16(dsi->sml_pbi.category);
-  B2N_32(dsi->sml_pbi.ilvu_ea);
-  B2N_32(dsi->sml_pbi.ilvu_sa);
-  B2N_16(dsi->sml_pbi.size);
-  B2N_32(dsi->sml_pbi.vob_v_s_s_ptm);
-  B2N_32(dsi->sml_pbi.vob_v_e_e_ptm);
+  dsi->sml_pbi.category = getbits(&state, 16 );
+  dsi->sml_pbi.ilvu_ea = getbits(&state, 32 );
+  dsi->sml_pbi.ilvu_sa = getbits(&state, 32 );
+  dsi->sml_pbi.size = getbits(&state, 16 );
+  dsi->sml_pbi.vob_v_s_s_ptm = getbits(&state, 32 );
+  dsi->sml_pbi.vob_v_e_e_ptm = getbits(&state, 32 );
+  for(i = 0; i < 8; i++) {
+    dsi->sml_pbi.vob_a[i].stp_ptm1 = getbits(&state, 32 );
+    dsi->sml_pbi.vob_a[i].stp_ptm2 = getbits(&state, 32 );
+    dsi->sml_pbi.vob_a[i].gap_len1 = getbits(&state, 32 );
+    dsi->sml_pbi.vob_a[i].gap_len2 = getbits(&state, 32 );
+  }
 
   /* dsi sml agli */
   for(i = 0; i < 9; i++) {
-    B2N_32(dsi->sml_agli.data[ i ].address);
-    B2N_16(dsi->sml_agli.data[ i ].size);
+    dsi->sml_agli.data[ i ].address = getbits(&state, 32 );
+    dsi->sml_agli.data[ i ].size = getbits(&state, 16 );
   }
 
   /* dsi vobu sri */
-  B2N_32(dsi->vobu_sri.next_video);
+  dsi->vobu_sri.next_video = getbits(&state, 32 );
   for(i = 0; i < 19; i++)
-    B2N_32(dsi->vobu_sri.fwda[i]);
-  B2N_32(dsi->vobu_sri.next_vobu);
-  B2N_32(dsi->vobu_sri.prev_vobu);
+    dsi->vobu_sri.fwda[i] = getbits(&state, 32 );
+  dsi->vobu_sri.next_vobu = getbits(&state, 32 );
+  dsi->vobu_sri.prev_vobu = getbits(&state, 32 );
   for(i = 0; i < 19; i++)
-    B2N_32(dsi->vobu_sri.bwda[i]);
-  B2N_32(dsi->vobu_sri.prev_video);
+    dsi->vobu_sri.bwda[i] = getbits(&state, 32 );
+  dsi->vobu_sri.prev_video = getbits(&state, 32 );
 
   /* dsi synci */
   for(i = 0; i < 8; i++)
-    B2N_16(dsi->synci.a_synca[i]);
+    dsi->synci.a_synca[i] = getbits(&state, 16 );
   for(i = 0; i < 32; i++)
-    B2N_32(dsi->synci.sp_synca[i]);
+    dsi->synci.sp_synca[i] = getbits(&state, 32 );
 
   
   /* Asserts */
--- dvdread/nav_read.h	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/nav_read.h	2008-08-30 00:38:24.000000000 +0200
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/nav_types.h>
+#include <libdvdread/nav_types.h>
 
 /**
  * Parsing of NAV data, PCI and DSI parts.
--- dvdread/nav_types.h	2005-09-06 21:23:00.000000000 +0200
+++ libdvdread/nav_types.h	2008-08-30 00:38:07.000000000 +0200
@@ -30,7 +30,7 @@
  * USA
  */
 
-#include <dvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */
+#include <libdvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */
 /* If it's ever removed add a uintX_t test. */
 
 #undef ATTRIBUTE_PACKED
@@ -102,7 +102,6 @@
   uint32_t hli_s_ptm;              /**< start ptm of hli */
   uint32_t hli_e_ptm;              /**< end ptm of hli */
   uint32_t btn_se_e_ptm;           /**< end ptm of button select */
-#ifdef WORDS_BIGENDIAN
   unsigned int zero1 : 2;          /**< reserved */
   unsigned int btngr_ns : 2;       /**< number of button groups 1, 2 or 3 with 36/18/12 buttons */
   unsigned int zero2 : 1;          /**< reserved */
@@ -111,16 +110,6 @@
   unsigned int btngr2_dsp_ty : 3;  /**< display type of subpic stream for button group 2 */
   unsigned int zero4 : 1;          /**< reserved */
   unsigned int btngr3_dsp_ty : 3;  /**< display type of subpic stream for button group 3 */
-#else
-  unsigned int btngr1_dsp_ty : 3;
-  unsigned int zero2 : 1;
-  unsigned int btngr_ns : 2;
-  unsigned int zero1 : 2;
-  unsigned int btngr3_dsp_ty : 3;
-  unsigned int zero4 : 1;
-  unsigned int btngr2_dsp_ty : 3;
-  unsigned int zero3 : 1;
-#endif
   uint8_t btn_ofn;     /**< button offset number range 0-255 */
   uint8_t btn_ns;      /**< number of valid buttons  <= 36/18/12 (low 6 bits) */  
   uint8_t nsl_btn_ns;  /**< number of buttons selectable by U_BTNNi (low 6 bits)   nsl_btn_ns <= btn_ns */
@@ -150,47 +139,24 @@
  * The 4 and 7 bytes are 'rotated' was: ABC DEF GHIJ  is: ABCG DEFH IJ
  */
 typedef struct {
-#ifdef WORDS_BIGENDIAN
   unsigned int btn_coln         : 2;  /**< button color number */
   unsigned int x_start          : 10; /**< x start offset within the overlay */
   unsigned int zero1            : 2;  /**< reserved */
   unsigned int x_end            : 10; /**< x end offset within the overlay */
 
-  unsigned int zero3            : 2;  /**< reserved */
-  unsigned int up               : 6;  /**< button index when pressing up */
-
   unsigned int auto_action_mode : 2;  /**< 0: no, 1: activated if selected */
   unsigned int y_start          : 10; /**< y start offset within the overlay */
   unsigned int zero2            : 2;  /**< reserved */
   unsigned int y_end            : 10; /**< y end offset within the overlay */
 
+  unsigned int zero3            : 2;  /**< reserved */
+  unsigned int up               : 6;  /**< button index when pressing up */
   unsigned int zero4            : 2;  /**< reserved */
   unsigned int down             : 6;  /**< button index when pressing down */
   unsigned int zero5            : 2;  /**< reserved */
   unsigned int left             : 6;  /**< button index when pressing left */
   unsigned int zero6            : 2;  /**< reserved */
   unsigned int right            : 6;  /**< button index when pressing right */
-#else
-  unsigned int x_end            : 10;
-  unsigned int zero1            : 2;
-  unsigned int x_start          : 10;
-  unsigned int btn_coln         : 2;
-
-  unsigned int up               : 6;
-  unsigned int zero3            : 2;
-
-  unsigned int y_end            : 10;
-  unsigned int zero2            : 2;
-  unsigned int y_start          : 10;
-  unsigned int auto_action_mode : 2;
-
-  unsigned int down             : 6;
-  unsigned int zero4            : 2;
-  unsigned int left             : 6;
-  unsigned int zero5            : 2;
-  unsigned int right            : 6;
-  unsigned int zero6            : 2;
-#endif
   vm_cmd_t cmd;
 } ATTRIBUTE_PACKED btni_t;
 
-------------- next part --------------
Index: stream/stream_dvd_common.h
===================================================================
--- stream/stream_dvd_common.h	(revision 27495)
+++ stream/stream_dvd_common.h	(working copy)
@@ -4,9 +4,9 @@
 #include "config.h"
 #include <inttypes.h>
 #ifdef CONFIG_DVDREAD_INTERNAL
+#include "libdvdread/ifo_types.h"
+#else
 #include <dvdread/ifo_types.h>
-#else
-#include <libdvdread/ifo_types.h>
 #endif
 
 int mp_dvdtimetomsec(dvd_time_t *dt);
Index: stream/stream_dvd.h
===================================================================
--- stream/stream_dvd.h	(revision 27495)
+++ stream/stream_dvd.h	(working copy)
@@ -4,15 +4,15 @@
 #include "config.h"
 #include <stdint.h>
 #ifdef CONFIG_DVDREAD_INTERNAL
-#include "dvdread/dvd_reader.h"
-#include "dvdread/ifo_types.h"
-#include "dvdread/ifo_read.h"
-#include "dvdread/nav_read.h"
+#include "libdvdread/dvd_reader.h"
+#include "libdvdread/ifo_types.h"
+#include "libdvdread/ifo_read.h"
+#include "libdvdread/nav_read.h"
 #else
-#include <libdvdread/dvd_reader.h>
-#include <libdvdread/ifo_types.h>
-#include <libdvdread/ifo_read.h>
-#include <libdvdread/nav_read.h>
+#include <dvdread/dvd_reader.h>
+#include <dvdread/ifo_types.h>
+#include <dvdread/ifo_read.h>
+#include <dvdread/nav_read.h>
 #endif
 #include "stream.h"
 
Index: configure
===================================================================
--- configure	(revision 27495)
+++ configure	(working copy)
@@ -5475,10 +5475,10 @@
   if test "$_dl" = yes; then
     cat > $TMPC << EOF
 #include <inttypes.h>
-#include <libdvdread/dvd_reader.h>
-#include <libdvdread/ifo_types.h>
-#include <libdvdread/ifo_read.h>
-#include <libdvdread/nav_read.h>
+#include <dvdread/dvd_reader.h>
+#include <dvdread/ifo_types.h>
+#include <dvdread/ifo_read.h>
+#include <dvdread/nav_read.h>
 int main(void) { return 0; }
 EOF
   fi
Index: Makefile
===================================================================
--- Makefile	(revision 27495)
+++ Makefile	(working copy)
@@ -236,15 +236,15 @@
 SRCS_COMMON-$(DVDNAV)                += stream/stream_dvdnav.c
 SRCS_COMMON-$(DVDREAD)               += stream/stream_dvd.c \
                                         stream/stream_dvd_common.c
-SRCS_COMMON-$(DVDREAD_INTERNAL)      += dvdread/cmd_print.c \
-                                        dvdread/dvd_input.c \
-                                        dvdread/dvd_reader.c \
-                                        dvdread/dvd_udf.c \
-                                        dvdread/ifo_print.c \
-                                        dvdread/ifo_read.c \
-                                        dvdread/md5.c \
-                                        dvdread/nav_print.c \
-                                        dvdread/nav_read.c \
+SRCS_COMMON-$(DVDREAD_INTERNAL)      += libdvdread/cmd_print.c \
+                                        libdvdread/dvd_input.c \
+                                        libdvdread/dvd_reader.c \
+                                        libdvdread/dvd_udf.c \
+                                        libdvdread/ifo_print.c \
+                                        libdvdread/ifo_read.c \
+                                        libdvdread/md5.c \
+                                        libdvdread/nav_print.c \
+                                        libdvdread/nav_read.c \
 
 SRCS_COMMON-$(FAAD)                  += libmpcodecs/ad_faad.c
 SRCS_COMMON-$(FAAD_INTERNAL)         += libfaad2/bits.c \
@@ -655,7 +655,6 @@
 INSTALL_TARGETS-$(MPLAYER)  += install-mplayer  install-mplayer-man
 
 DIRS =  . \
-        dvdread \
         gui \
         gui/mplayer \
         gui/mplayer/gtk \
@@ -679,6 +678,7 @@
         libavformat \
         libavutil \
         libdvdcss \
+        libdvdread \
         libfaad2 \
         libmenu \
         libmpcodecs \
@@ -783,8 +783,8 @@
 mencoder.d mplayer.d vobsub.d gui/win32/gui.d libmpdemux/muxer_avi.d osdep/mplayer-rc.o stream/network.d stream/stream_cddb.d: version.h
 $(DEPS): help_mp.h
 
-dvdread/%.o dvdread/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DHAVE_CONFIG_H $(CFLAGS_LIBDVDCSS_DVDREAD)
 libdvdcss/%.o libdvdcss/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\" $(CFLAGS_LIBDVDCSS)
+libdvdread/%.o libdvdread/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DHAVE_CONFIG_H $(CFLAGS_LIBDVDCSS_DVDREAD)
 libfaad2/%.o libfaad2/%.d: CFLAGS += -Ilibfaad2 -D_GNU_SOURCE -DHAVE_CONFIG_H $(CFLAGS_FAAD_FIXED)
 
 loader/% loader/%: CFLAGS += -Iloader -fno-omit-frame-pointer $(CFLAGS_NO_OMIT_LEAF_FRAME_POINTER)
Index: Copyright
===================================================================
--- Copyright	(revision 27495)
+++ Copyright	(working copy)
@@ -51,7 +51,7 @@
 Name:       libdvdread
 Version:    0.9.7 + patches
 Homepage:   http://www.dtek.chalmers.se/groups/dvd/development.shtml
-Directory:  dvdread
+Directory:  libdvdread
 Copyright:  1998, 1999 Eric Smith <eric at brouhaha.com>
             1999 Christian Wolff for convergence integrated media
             2000-2001 Billy Biggs <vektor at dumbterm.net>,
Index: libdvdread/ifo_print.h
===================================================================
--- libdvdread/ifo_print.h	(revision 27495)
+++ libdvdread/ifo_print.h	(working copy)
@@ -21,8 +21,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/ifo_types.h>
-#include <dvdread/dvd_reader.h>
+#include <libdvdread/ifo_types.h>
+#include <libdvdread/dvd_reader.h>
 
 #ifdef __cplusplus
 extern "C" {
Index: libdvdread/nav_print.h
===================================================================
--- libdvdread/nav_print.h	(revision 27495)
+++ libdvdread/nav_print.h	(working copy)
@@ -21,7 +21,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/nav_types.h>
+#include <libdvdread/nav_types.h>
 
 /**
  * Pretty printing of the NAV packets, PCI and DSI structs.
Index: libdvdread/ifo_types.h
===================================================================
--- libdvdread/ifo_types.h	(revision 27495)
+++ libdvdread/ifo_types.h	(working copy)
@@ -25,7 +25,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/dvd_reader.h>
+#include <libdvdread/dvd_reader.h>
 
 #if defined(__BEOS__)
 #if !defined(_INTTYPES_H_) && !defined(_INTTYPES_H) && !defined(_STDINT_H_) && !defined(_STDINT_H)
Index: libdvdread/nav_types.h
===================================================================
--- libdvdread/nav_types.h	(revision 27495)
+++ libdvdread/nav_types.h	(working copy)
@@ -30,7 +30,7 @@
  * USA
  */
 
-#include <dvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */
+#include <libdvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */
 /* If it's ever removed add a uintX_t test. */
 
 #undef ATTRIBUTE_PACKED
Index: libdvdread/ifo_read.h
===================================================================
--- libdvdread/ifo_read.h	(revision 27495)
+++ libdvdread/ifo_read.h	(working copy)
@@ -21,8 +21,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/ifo_types.h>
-#include <dvdread/dvd_reader.h>
+#include <libdvdread/ifo_types.h>
+#include <libdvdread/dvd_reader.h>
 
 #ifdef __cplusplus
 extern "C" {
Index: libdvdread/nav_read.h
===================================================================
--- libdvdread/nav_read.h	(revision 27495)
+++ libdvdread/nav_read.h	(working copy)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/nav_types.h>
+#include <libdvdread/nav_types.h>
 
 /**
  * Parsing of NAV data, PCI and DSI parts.
Index: libdvdread/cmd_print.h
===================================================================
--- libdvdread/cmd_print.h	(revision 27495)
+++ libdvdread/cmd_print.h	(working copy)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <dvdread/ifo_types.h>
+#include <libdvdread/ifo_types.h>
 
 /**
  * Pretty printing of the DVD commands (vm instructions).


More information about the MPlayer-dev-eng mailing list