]> git.sesse.net Git - vlc/commitdiff
* ALL: removed libdvdcss from the vlc tree.
authorSam Hocevar <sam@videolan.org>
Wed, 3 Apr 2002 06:23:08 +0000 (06:23 +0000)
committerSam Hocevar <sam@videolan.org>
Wed, 3 Apr 2002 06:23:08 +0000 (06:23 +0000)
  * ALL: removed libdvdread from the vlc tree.
  * ./acconfig.h: removed this file.
  * ./plugins/dvd/dummy_dvdcss.c: merged this file into dvd.c.
  * ./AUTHORS: moved a few gentlemen to the libdvdcss AUTHORS file.

66 files changed:
AUTHORS
ChangeLog.libdvdcss [deleted file]
INSTALL.libdvdcss [deleted file]
Makefile
Makefile.opts.in
README.libdvdcss [deleted file]
acconfig.h [deleted file]
configure
configure.in
debian/.cvsignore
debian/control
debian/libdvdcss1-dev.dirs [deleted file]
debian/libdvdcss1.copyright [deleted file]
debian/libdvdcss1.dirs [deleted file]
debian/libdvdcss1.docs [deleted file]
debian/rules
doc/release-howto.txt
extras/BSDI_dvdioctl/COPYING [deleted file]
extras/BSDI_dvdioctl/Makefile [deleted file]
extras/BSDI_dvdioctl/blkreset.c [deleted file]
extras/BSDI_dvdioctl/dvd.h [deleted file]
extras/BSDI_dvdioctl/dvdioctl.c [deleted file]
extras/libdvdcss/.cvsignore [deleted file]
extras/libdvdcss/Makefile [deleted file]
extras/libdvdcss/css.c [deleted file]
extras/libdvdcss/css.h [deleted file]
extras/libdvdcss/csstables.h [deleted file]
extras/libdvdcss/ioctl.c [deleted file]
extras/libdvdcss/ioctl.h [deleted file]
extras/libdvdcss/libdvdcss.c [deleted file]
extras/libdvdcss/libdvdcss.h [deleted file]
extras/libdvdcss/libdvdcss.spec [deleted file]
extras/libdvdcss/videolan/dvdcss.h [deleted file]
extras/libdvdread/.cvsignore [deleted file]
extras/libdvdread/Makefile [deleted file]
extras/libdvdread/bswap.h [deleted file]
extras/libdvdread/dvd_reader.c [deleted file]
extras/libdvdread/dvd_reader.h [deleted file]
extras/libdvdread/dvd_setup.c [deleted file]
extras/libdvdread/dvd_setup.h [deleted file]
extras/libdvdread/dvd_udf.c [deleted file]
extras/libdvdread/dvd_udf.h [deleted file]
extras/libdvdread/ifo_print.c [deleted file]
extras/libdvdread/ifo_print.h [deleted file]
extras/libdvdread/ifo_read.c [deleted file]
extras/libdvdread/ifo_read.h [deleted file]
extras/libdvdread/ifo_types.h [deleted file]
extras/libdvdread/nav_print.c [deleted file]
extras/libdvdread/nav_print.h [deleted file]
extras/libdvdread/nav_read.c [deleted file]
extras/libdvdread/nav_read.h [deleted file]
extras/libdvdread/nav_types.h [deleted file]
include/defs.h.in
ipkg/rules
plugins/dvd/Makefile
plugins/dvd/dummy_dvdcss.c [deleted file]
plugins/dvd/dvd.c
plugins/dvd/dvd_access.c
plugins/dvd/dvd_es.c
plugins/dvd/dvd_ifo.c
plugins/dvd/dvd_seek.c
plugins/dvd/dvd_summary.c
plugins/dvd/dvd_udf.c
plugins/dvdread/Makefile
plugins/dvdread/input_dvdread.h
vlc.spec

diff --git a/AUTHORS b/AUTHORS
index 8cf254ddbcb82b96e0fd56f83123a85ee0a5269c..8b040dd8207e6dc21746e578e6c49b30c98857de 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,10 +35,6 @@ C: gbazin
 D: mingw32 port, various win32 fixes
 D: DirectX audio and video output
 
-N: Billy Biggs 
-E: vektor@dumbterm.net
-D: libdvdcss enhancements
-
 N: Johan Bilien
 E: jobi@via.ecp.fr
 C: jobi
@@ -141,11 +137,6 @@ E: jimmy@via.ecp.fr
 C: jimmy
 D: IDCT and YUV transformations
 
-N: Håkan Hjort
-E: d95hjort@dtek.chalmers.se
-D: Solaris port of the DVD ioctls
-D: libdvdcss enhancements
-
 N: Samuel Hocevar
 E: sam@zoy.org
 C: sam
@@ -165,7 +156,7 @@ D: patch for module options handling
 N: Eugenio Jarosiewicz
 E: ej0@cise.ufl.edu
 C: ej
-D: MacOS X interface, DVD ioctls, and various fixes
+D: MacOS X interface, and various fixes
 
 N: Brieuc Jeunhomme
 E: bbp@via.ecp.fr
@@ -204,10 +195,6 @@ N: Mathias Kretschmer
 E: mathias@research.att.com
 D: IP Multicast support
 
-N: Markus Kuespert
-E: ltlBeBoy@beosmail.com
-D: BeOS port of the DVD ioctls
-
 N: Michel Lespinasse
 E: walken@zoy.org
 C: walken
@@ -275,10 +262,6 @@ E: richard@rshepherd.demon.co.uk
 C: richards
 D: BeOS video output (BBitmap and Overlay)
 
-N: David Siebörger
-E: drs-videolan@rucus.ru.ac.za
-D: HP-UX port of the DVD ioctls
-
 N: Espen Skoglund
 E: esk@ira.uka.de
 D: FreeBSD autoconf and Makefile patches
@@ -293,7 +276,3 @@ N: Peter Surda
 E: shurdeek@panorama.sth.ac.at
 D: rc plugin for vlc control through /dev/stdin
 
-N: German Tischler
-E: tanis@gaspode.franken.de
-D: FreeBSD DVD input patch
-
diff --git a/ChangeLog.libdvdcss b/ChangeLog.libdvdcss
deleted file mode 100644 (file)
index cc3eb98..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#=========================#
-# ChangeLog for libdvdcss #
-#=========================#
-
-HEAD
-
-  * Support for REPORT_TITLE_KEY and RPC commands by Håkan Hjort
-    <d95hjort@dtek.chalmers.se>.
-  * HP-UX port courtesy of David Siebörger <drs-videolan@rucus.ru.ac.za>.
-
-1.0.1
-Fri,  7 Dec 2001 20:18:56 +0100
-
-  * Update for libdvdcss documentation.
-  * Reworked Keith Packard's raw device patch. The name of the raw device
-    is in the environment variable DVDCSS_RAW_DEVICE.
-  * Fixed a bug in libdvdcss: the key wasn't searched when it had to.
-
-1.0.0
-Mon, 12 Nov 2001 17:14:29 +0100
-
-  * Got rid of DVDCSS_SEEK_INI.
-  * Removed the i_flags argument to dvdcss_open. Everything is done through
-    environment variables now.
-  * Fixed a buffer overflow in CSSAuth().
-  * libdvdcss port to OpenBSD.
-  * Fixed NetBSD (and probably OpenBSD) libdvdcss compilation.
-  * Fixed undefined KEY_SIZE compile bug mentioned by Dave Thorup.
-  * Fixed CSS ioctl for Darwin/OSX - still might need tweaking of 'dataLength'
-    fields.
-  * Added ReadTitleKey ioctl for Darwin/OSX.
-  * When using title cracking method in libdvdcss, the key is only checked at
-    title start, not before each chapter.
-  * Use of an environment variable to choose libdvdcss method.
-  * New features for libdvdcss: we have three ways now to decode a title key.
-  * 1) Crack the title key (the method that was here before). The only change
-    here is that we search the key for the exact chapter we are seeking with
-    DVDSetArea (in case the key has changed within a title). It is maybe not a
-    good idea.
-  * 2) Crack the disc key, which allows us to decode instantly all title keys.
-    I've used an algorithm from Frank Stevenson ; it eats much memory (64MB),
-    and takes about 15 s at launch time.
-  * 3) Decode the disc key with player keys (libcss method). However, you need
-    licensed player keys at build time for this to work.
-  * Darwin ioctl, courtesy of ej0.
-  * If we see 3000 unencrypted blocks assume that the title is unencrypted.
-  * If we have not seen any encrypted block and then discover that the block
-    just read is not a valid block of an MPEG2 Program stream, assume that the
-    title is unencrypted.
-  * Empty keys (for unscrambled sectors) are now cached as well.
-  * We try to decrypt the file even if DVD ioctls are not available.
-
-0.0.3
-Wed, 22 Aug 2001 15:18:01 +0200
-
-  * Added BSD/OS libdvd by Steven M. Schultz <sms@TO.GD-ES.COM> in
-    extras/BSDI_dvdioctl after he suggested us to do so. License is GPL.
-  * ./configure now checks for an installed libdvd under BSD/OS and
-    falls back to ours if not found.
-  * Fixed harmless typos in yesterday's Solaris libdvd patches.
-  * Bumped libdvdcss version number up to 0.0.3.
-  * Solaris DVD decryption support by Håkan Hjort <d95hjort@dtek.chalmers.se>.
-  * BSD/OS 4.3beta1 fixes by Steven M. Schultz <sms@TO.GD-ES.COM>.
-  * libdvdcss* packages are now a bit more policy-compliant.
-  * Fixed a Win32 bug in libdvdcss. This bug was appearing on title change.
-
-0.0.2
-Wed, 22 Aug 2001 15:18:01 +0200
-
-  * Fix in libdvdcss in the key caching code.
-  * Changed libdvdcss API to force binary incompatibility. Yeah, this is
-    evil, but if we don't do it now we'll have to do it when more people
-    are using it.
-  * Fixed minor libdvdcss stuff such as the soname and compilation flags.
-  * dvdcss_readv() optimisations for Win32.
-  * Fixed _win32_dvdcss_aread() to work around the WinASPI32 64kb transfer
-    size restriction.
-  * libdvdcss segfault fixes.
-  * Fixed 2 Win32 bugs in libdvdcss (in _win32_dvdcss_readv), one of them
-    should have prevented the Win9x dvd input from working.
-  * Moved the "if(Win2k)" out of the loop in _win32_dvdcss_readv.
-  * libdvdcss enhancements by Billy Biggs <vektor@dumbterm.net>. This breaks
-    vlc's DVD input (looks like decoders are expecting data too early and
-    DVD input can't cope with it due to decryption). Needs to be investigated.
-  * Removed unnecessary translations in the win32 code from block offsets to
-    byte offsets. This was overflowing some variables.
-  * Reduced the complexity of the Win9x ASPI functions because we only need
-    to handle DVD drive access.
-  * Win32 code now handles seeking in areas above 2.1 Go on DVDs.
-  * Additional MacOS X DVD ioctl work by Eugenio Jarosiewicz
-    <ej0@cise.ufl.edu>.
-
-0.0.1
-Tue, 19 Jun 2001 08:53:16 +0200
-
-  * First libdvdcss version (0.0.1).
-  * Fully working Windows DVD ioctl support by Jon Lech Johansen.
-  * Merged dvdcss_init and dvdcss_open into dvdcss_open, and dvdcss_close
-    and dvdcss_end into dvdcss_close. libdvdcss API now has 7 functions.
-  * Exported the CSS part of the dvd plugin into a library.
-
diff --git a/INSTALL.libdvdcss b/INSTALL.libdvdcss
deleted file mode 100644 (file)
index b2ca727..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-INSTALL file for libdvdcss, a DVD access library
-
-
-Configuring libdvdcss
-=====================
-
-A typical way to configure libdvdcss is:
-
-   ./configure --prefix=/usr
-
-See `./configure --help' for more information.
-
-It is also possible to cross-compile for the Win32 platform using mingw32:
-
-   CC=i586-mingw32msvc-gcc CFLAGS=-I/usr/i586-mingw32msvc \
-     RANLIB=i586-mingw32msvc-ranlib ./configure --host=i386-mingw32msvc \
-     --target=i386-mingw32msvc --build=i386-linux
-
-
-Building libdvdcss
-==================
-
-Once configured, run `make' to build libdvdcss.
-
-If you have player keys, you need to put them in the file csskeys.h, before
-configuring libdvdcss to enable the "key" method (the one from libcss).
-
-
-Installing libdvdcss
-====================
-
-You can install libdvdcss by typing:
-
-   make install
-
-
index 736007a3160cc6ef3da901d5b671ba010803d34e..c04af35f6a24cef52ba7f8a285b29ec2284c6999 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -210,8 +210,6 @@ endif
 # Misc variables
 #
 VLC_QUICKVERSION := $(shell grep '^ *VLC_VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
-LIBDVDCSS_QUICKVERSION := $(shell grep '^ *LIBDVDCSS_VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
-
 
 # All symbols must be exported
 export
@@ -247,21 +245,15 @@ show:
 #
 # Cleaning rules
 #
-clean: libdvdcss-clean libdvdread-clean plugins-clean po-clean vlc-clean
+clean: plugins-clean po-clean vlc-clean
        rm -f src/*/*.o extras/*/*.o
        rm -f lib/*.so* lib/*.a
        rm -f plugins/*.so plugins/*.a
        rm -rf extras/MacOSX/build
 
-libdvdcss-clean:
-       -cd extras/libdvdcss && $(MAKE) clean
-
 po-clean:
        -cd po && $(MAKE) clean
 
-libdvdread-clean:
-       -cd extras/libdvdread && $(MAKE) clean
-
 plugins-clean:
        for dir in $(PLUGINS_DIR) ; do \
                ( cd plugins/$${dir} \
@@ -287,9 +279,9 @@ distclean: clean
 #
 # Install/uninstall rules
 #
-install: libdvdcss-install vlc-install plugins-install po-install
+install: vlc-install plugins-install po-install
 
-uninstall: libdvdcss-uninstall vlc-uninstall plugins-uninstall po-uninstall
+uninstall: vlc-uninstall plugins-uninstall po-uninstall
 
 vlc-install:
        mkdir -p $(DESTDIR)$(bindir)
@@ -320,18 +312,6 @@ endif
 plugins-uninstall:
        rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
 
-libdvdcss-install:
-       -cd extras/libdvdcss && $(MAKE) install
-
-libdvdcss-uninstall:
-       -cd extras/libdvdcss && $(MAKE) uninstall
-
-libdvdread-install:
-       -cd extras/libdvdread && $(MAKE) install
-
-libdvdread-uninstall:
-       -cd extras/libdvdread && $(MAKE) uninstall
-
 po-install:
        -cd po && $(MAKE) install
 
@@ -374,7 +354,7 @@ snapshot-common:
        cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
                Makefile Makefile.opts.in Makefile.dep Makefile.modules \
                configure configure.in install-sh install-win32 vlc.spec \
-               config.sub config.guess acconfig.h aclocal.m4 mkinstalldirs \
+               config.sub config.guess aclocal.m4 mkinstalldirs \
                        tmp/vlc/
        # Copy Debian control files
        for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
@@ -400,18 +380,12 @@ snapshot: snapshot-common
        rm -Rf tmp
 
 snapshot-nocss: snapshot-common
-       # Remove libdvdcss
-       rm -Rf tmp/vlc/extras/libdvdcss
-       rm -f tmp/vlc/*.libdvdcss
        # Fix debian information
-       rm -f tmp/vlc/debian/libdvdcss*
        rm -f tmp/vlc/debian/control
        sed -e 's#^ DVDs# unencrypted DVDs#' < debian/control \
-               | awk '{if(gsub("Package: libdvdcss",$$0))a=1;if(a==0)print $$0;if(a==1&&$$0=="")a=0}' \
                > tmp/vlc/debian/control
        rm -f tmp/vlc/debian/rules
-       sed -e 's#^\(export LIBDVDCSS_FLAGS=\).*#\1"--without-dvdcss"#' < debian/rules \
-               | awk '{if($$0=="# libdvdcss start")a=1;if(a==0)print $$0;if($$0=="# libdvdcss stop")a=0}' \
+       sed -e 's#^\(export DVDCSS_FLAGS=\).*#\1"--enable-dvd --without-dvdcss"#' < debian/rules \
                > tmp/vlc/debian/rules
        chmod +x tmp/vlc/debian/rules
        # Build css-disabled archives
@@ -437,8 +411,7 @@ package-win32:
        # Copy relevant files
        cp vlc.exe $(PLUGINS:%=plugins/%.so) tmp/ 
        cp INSTALL.win32 tmp/INSTALL.txt ; unix2dos tmp/INSTALL.txt
-       for file in AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
-               README README.libdvdcss FAQ TODO ; \
+       for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
                        do cp $$file tmp/$${file}.txt ; \
                        unix2dos tmp/$${file}.txt ; done
        for file in iconv.dll libgmodule-1.3-12.dll libgtk-0.dll libgdk-0.dll \
@@ -467,8 +440,7 @@ package-beos:
        mkdir -p tmp/vlc/share
        # Copy relevant files
        cp vlc tmp/vlc/
-       cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
-               README README.libdvdcss FAQ TODO tmp/vlc/
+       cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
        for file in default8x16.psf default8x9.psf ; \
                do cp share/$$file tmp/vlc/share/ ; done
        # Create package 
@@ -489,8 +461,7 @@ package-macosx:
 
        # Copy relevant files 
        cp -R vlc.app tmp/
-       cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
-               README README.libdvdcss FAQ TODO tmp/
+       cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/
 
        # Create disk image 
        ./macosx-dmg 0 "vlc-${VLC_QUICKVERSION}" tmp/* 
@@ -498,39 +469,6 @@ package-macosx:
        # Clean up
        rm -Rf tmp
 
-libdvdcss-snapshot: snapshot-common
-       # Remove vlc sources and icons, doc, debian directory...
-       rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc
-       rm -Rf tmp/vlc/extras/GNUgetopt tmp/vlc/extras/MacOSX
-       rm -Rf tmp/vlc/debian
-       rm -Rf tmp/vlc/ipkg
-       # Remove useless headers
-       rm -f tmp/vlc/include/*
-       for file in defs.h.in config.h common.h int_types.h ; \
-               do cp include/$$file tmp/vlc/include/ ; done
-       # Remove misc files (??? - maybe not really needed)
-       rm -f tmp/vlc/vlc.spec tmp/vlc/INSTALL-win32.txt
-       mv tmp/vlc/INSTALL.libdvdcss tmp/vlc/INSTALL
-       mv tmp/vlc/README.libdvdcss tmp/vlc/README
-       mv tmp/vlc/ChangeLog.libdvdcss tmp/vlc/ChangeLog
-       # Fix Makefile
-       rm -f tmp/vlc/Makefile
-       sed -e 's#^install:#install-unused:#' \
-               -e 's#^uninstall:#uninstall-unused:#' \
-               -e 's#^clean:#clean-unused:#' \
-               -e 's#^all:.*#all: libdvdcss#' \
-               -e 's#^libdvdcss-install:#install:#' \
-               -e 's#^libdvdcss-uninstall:#uninstall:#' \
-               -e 's#^libdvdcss-clean:#clean:#' \
-               < Makefile > tmp/vlc/Makefile
-       # Build archives
-       F=libdvdcss-${LIBDVDCSS_QUICKVERSION}; \
-       mv tmp/vlc tmp/$$F; (cd tmp ; tar cf $$F.tar $$F); \
-       bzip2 -f -9 < tmp/$$F.tar > $$F.tar.bz2; \
-       gzip -f -9 tmp/$$F.tar ; mv tmp/$$F.tar.gz .
-       # Clean up
-       rm -Rf tmp
-
 deb:
        dpkg-buildpackage -rfakeroot -us -uc
 
@@ -630,18 +568,6 @@ builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
 $(BUILTIN_OBJ): FORCE
        @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
 
-#
-# libdvdcss target
-#
-libdvdcss: Makefile.opts
-       @cd extras/libdvdcss && $(MAKE)
-
-#
-# libdvdread target
-#
-libdvdread: Makefile.opts
-       @cd extras/libdvdread && $(MAKE)
-
 #
 # gettext target
 #
index 7ad341481c7e3c4c762b1ed698f7bc656d995f1d..9d03cddbf0064f9390ae28ac7a174abc1b66a6d7 100644 (file)
@@ -92,8 +92,6 @@ LIB_IMDCTSSE = @LIB_IMDCTSSE@
 LIB_IPV4 = @LIB_IPV4@
 LIB_IPV6 = @LIB_IPV6@
 LIB_KDE = @LIB_KDE@
-LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
-LIB_LIBDVDREAD = @LIB_LIBDVDREAD@
 LIB_LIRC = @LIB_LIRC@
 LIB_MACOSX = @LIB_MACOSX@
 LIB_MAD = @LIB_MAD@
@@ -125,7 +123,6 @@ CFLAGS_GNOME = @CFLAGS_GNOME@
 CFLAGS_GTK = @CFLAGS_GTK@
 CFLAGS_KDE = @CFLAGS_KDE@
 CFLAGS_IDCTALTIVEC = @CFLAGS_IDCTALTIVEC@
-CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
 CFLAGS_MACOSX = @CFLAGS_MACOSX@
 CFLAGS_MAD = @CFLAGS_MAD@
 CFLAGS_MOTIONALTIVEC = @CFLAGS_MOTIONALTIVEC@
@@ -135,17 +132,10 @@ CFLAGS_WIN32 = @CFLAGS_WIN32@
 CFLAGS_X11 = @CFLAGS_X11@
 CFLAGS_XVIDEO = @CFLAGS_XVIDEO@
 
-#
-# Additional objects
-#
-SRC_DVD_EXTRA = @SRC_DVD_EXTRA@
-SRC_DVDCSS_EXTRA = @SRC_DVDCSS_EXTRA@
-
 #
 # Other special cases
 #
 NEED_GETOPT = @NEED_GETOPT@
-NEED_LIBDVDCSS = @NEED_LIBDVDCSS@
 
 ###############################################################################
 # Configuration pre-processing
@@ -176,10 +166,6 @@ else
 PROGRAM_BUILD = `date` $(USER)@`hostname`
 endif
 
-# PROGRAM_VERSION is the current vlc version
-PROGRAM_VERSION=@VLC_VERSION@
-LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
-
 # DEFINE will contain some of the constants definitions decided in Makefile, 
 # including SYS_xx. It will be passed to C compiler.
 DEFINE_SYS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
@@ -304,11 +290,6 @@ ifneq (,$(findstring mingw32,$(SYS)))
 LDFLAGS += -mwindows -Xlinker --force-exe-suffix
 endif
 
-#
-# C compiler and linker flags: setting soname
-#
-SOFLAGS = @SOFLAGS@
-
 #
 # C compiler flags: plugin compilation
 #
diff --git a/README.libdvdcss b/README.libdvdcss
deleted file mode 100644 (file)
index 20defe8..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-README for libdvdcss, a portable abstraction library for DVD decryption
-
-
-Introduction
-============
-
-libdvdcss is part of the VideoLAN project, a full MPEG2 client/server
-solution. The VideoLAN Client can also be used as a standalone program
-to play MPEG2 streams from a hard disk or a DVD.
-
-
-Building and Installing libdvdcss
-=================================
-
-See the INSTALL or INSTALL.libdvdcss file for this.
-
-Running lidvdcss
-================
-
-The behaviourof the library can be affected by changing two environment
-variables:
-  DVDCSS_METHOD={title|disc|key}: method for key decryption
-    title: decrypted title key is guessed from the encrypted sectors of
-           the stream. Thus it should work with a file as well as the
-           DVD device. But it sometimes takes much time to decrypt a title
-           key and may even fail. With this method, the key is only checked
-           at the beginning of each title, so it won't work if the key
-           changes in the middle of a title.
-           This is the default method,
-    disc: the disc key is first cracked ; then all title keys can be
-           decrypted instantly, which allows us to check them often,
-    key: the same as "disc" if you don't have a file with player keys at
-           compilation time. If you do, the decryption of the disc key
-           will be faster with this method. It is the one that was used by
-           libcss.
-  DVDCSS_VERBOSE={0|1|2}: libdvdcss verbosity
-    0: no error messages, no debug messages,
-    1: only error messages (this is the default)
-    2: error and debug messages
-
-
-Troubleshooting
-===============
-
-A mailing-list has been set up for support and discussion about vlc and
-libdvdcss. Its address is :
-
-   <vlc@videolan.org>
-
-To subscribe, send a mail to <listar@videolan.org> with the following
-words in the mail body :
-
-   subscribe vlc
-
-To unsubscribe, do the same with the words :
-
-   unsubscribe vlc
-
-
-When reporting bugs, try to be as precise as possible (which OS, which
-distribution, what plugins you were trying, and so on).
-
-
-Resources
-=========
-
-The VideoLAN web site at http://www.videolan.org/ is a good start for
-information about MPEG and DVD playing. Have a look at the documentation
-section, as well as the bookmarks.
-
diff --git a/acconfig.h b/acconfig.h
deleted file mode 100644 (file)
index a219b3d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#undef PACKAGE
-#undef VERSION
-#undef DVD_DEVICE
-#undef VCD_DEVICE
-#undef COPYRIGHT_MESSAGE
-#undef MODULE_SUFFIX
-#undef MODULE_SYMBOL
-#undef VERSION_MESSAGE
index aaf0095907970bf99eba7296e9641f3863518a4e..fdcb6e6278a3be76c4992a0de3d25050b97ea136 100755 (executable)
--- a/configure
+++ b/configure
@@ -35,15 +35,17 @@ ac_help="$ac_help
 ac_help="$ac_help
 Input plugins:"
 ac_help="$ac_help
-  --with-dvdcss[=name]    use libdvdcss, either 'yes', 'no', 'local-static',
-                          'local-shared', or a path to another libdvdcss such
-                          as '/usr/local' (default 'local-static')"
+  --enable-dvd            DVD input module (default enabled)"
 ac_help="$ac_help
-  --with-dvdread[=name]   use libdvdread, same options as dvdcss (default 'no')"
+    --with-dvdcss=PATH    libdvdcss headers and libraries"
 ac_help="$ac_help
-  --enable-vcd            VCD support for Linux (default enabled)"
+  --enable-dvdread        dvdread input module (default disabled)"
 ac_help="$ac_help
-  --enable-satellite       Satellite card support (default disabled)"
+    --with-dvdread=PATH   libdvdread headers and libraries"
+ac_help="$ac_help
+  --enable-vcd            VCD support for Linux and MacOS X (default enabled)"
+ac_help="$ac_help
+  --enable-satellite      satellite card support (default disabled)"
 ac_help="$ac_help
 Codec plugins:"
 ac_help="$ac_help
@@ -689,7 +691,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:693: checking host system type" >&5
+echo "configure:695: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -710,7 +712,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:714: checking target system type" >&5
+echo "configure:716: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -728,7 +730,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:732: checking build system type" >&5
+echo "configure:734: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -751,31 +753,14 @@ test "$host_alias" != "$target_alias" &&
   program_prefix=${target_alias}-
 
 
-HAVE_VLC=0
-if test -r src/interface/main.c; then
-  HAVE_VLC=1
-  VLC_VERSION="0.2.92-dev"
-  VLC_CODENAME=Ourumov
-fi
-
-HAVE_LIBDVDCSS=0
-if test -r extras/libdvdcss/libdvdcss.c; then
-  HAVE_LIBDVDCSS=1
-  LIBDVDCSS_VERSION="1.0.1-dev"
-  
-  if test -r extras/libdvdcss/csskeys.h; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_CSSKEYS 1
-EOF
-
-  fi
-fi
+VERSION="0.2.92-dev"
+CODENAME=Ourumov
 
 save_CFLAGS="${CFLAGS}"
 save_LDFLAGS="${LDFLAGS}"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:779: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:764: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -804,7 +789,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:808: checking for $ac_word" >&5
+echo "configure:793: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -834,7 +819,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:838: checking for $ac_word" >&5
+echo "configure:823: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -885,7 +870,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:889: checking for $ac_word" >&5
+echo "configure:874: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -917,7 +902,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:906: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -928,12 +913,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 932 "configure"
+#line 917 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -959,12 +944,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:963: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:948: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:968: checking whether we are using GNU C" >&5
+echo "configure:953: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -973,7 +958,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -992,7 +977,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:996: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:981: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1024,7 +1009,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1028: checking how to run the C preprocessor" >&5
+echo "configure:1013: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1039,13 +1024,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1043 "configure"
+#line 1028 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1056,13 +1041,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1060 "configure"
+#line 1045 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1073,13 +1058,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1077 "configure"
+#line 1062 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1113,7 +1098,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1117: checking for $ac_word" >&5
+echo "configure:1102: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1145,7 +1130,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1149: checking for $ac_word" >&5
+echo "configure:1134: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1181,7 +1166,7 @@ fi
 # Extract the first word of "gmake", so it can be a program name with args.
 set dummy gmake; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1185: checking for $ac_word" >&5
+echo "configure:1170: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1216,7 +1201,7 @@ fi
 
 if test "x$GMAKE" = "xno"; then
   echo $ac_n "checking whether GNU make is installed""... $ac_c" 1>&6
-echo "configure:1220: checking whether GNU make is installed" >&5
+echo "configure:1205: checking whether GNU make is installed" >&5
 if eval "test \"`echo '$''{'ac_cv_gmake'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1242,13 +1227,13 @@ cat >> confdefs.h <<EOF
 EOF
 
 cat >> confdefs.h <<EOF
-#define VERSION "$VLC_VERSION"
+#define VERSION "$VERSION"
 EOF
 
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1252: checking for $ac_word" >&5
+echo "configure:1237: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1277,7 +1262,7 @@ fi
 
 
         echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:1281: checking for strerror in -lcposix" >&5
+echo "configure:1266: checking for strerror in -lcposix" >&5
 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1285,7 +1270,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1289 "configure"
+#line 1274 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1296,7 +1281,7 @@ int main() {
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:1300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1319,12 +1304,12 @@ fi
   
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1323: checking for ANSI C header files" >&5
+echo "configure:1308: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1328 "configure"
+#line 1313 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1332,7 +1317,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1349,7 +1334,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1353 "configure"
+#line 1338 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1367,7 +1352,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1371 "configure"
+#line 1356 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1388,7 +1373,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1392 "configure"
+#line 1377 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1399,7 +1384,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1423,12 +1408,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1427: checking for working const" >&5
+echo "configure:1412: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1432 "configure"
+#line 1417 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1477,7 +1462,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1498,21 +1483,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1502: checking for inline" >&5
+echo "configure:1487: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 1509 "configure"
+#line 1494 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1538,12 +1523,12 @@ EOF
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1542: checking for off_t" >&5
+echo "configure:1527: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1547 "configure"
+#line 1532 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1571,12 +1556,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1575: checking for size_t" >&5
+echo "configure:1560: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1580 "configure"
+#line 1565 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1606,19 +1591,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1610: checking for working alloca.h" >&5
+echo "configure:1595: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1615 "configure"
+#line 1600 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -1639,12 +1624,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1643: checking for alloca" >&5
+echo "configure:1628: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1648 "configure"
+#line 1633 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1672,7 +1657,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -1704,12 +1689,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1708: checking whether alloca needs Cray hooks" >&5
+echo "configure:1693: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1713 "configure"
+#line 1698 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1734,12 +1719,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1738: checking for $ac_func" >&5
+echo "configure:1723: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1743 "configure"
+#line 1728 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1762,7 +1747,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1789,7 +1774,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1793: checking stack direction for C alloca" >&5
+echo "configure:1778: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1797,7 +1782,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1801 "configure"
+#line 1786 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1816,7 +1801,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:1820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -1841,17 +1826,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1845: checking for $ac_hdr" >&5
+echo "configure:1830: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1850 "configure"
+#line 1835 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1880,12 +1865,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1884: checking for $ac_func" >&5
+echo "configure:1869: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 1874 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1908,7 +1893,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1933,7 +1918,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1937: checking for working mmap" >&5
+echo "configure:1922: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1941,7 +1926,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1945 "configure"
+#line 1930 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2081,7 +2066,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2105,12 +2090,12 @@ fi
 
 
     echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:2109: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo "configure:2094: checking whether we are using the GNU C Library 2.1 or newer" >&5
 if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2114 "configure"
+#line 2099 "configure"
 #include "confdefs.h"
 
 #include <features.h>
@@ -2146,17 +2131,17 @@ stdlib.h string.h unistd.h sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2150: checking for $ac_hdr" >&5
+echo "configure:2135: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2155 "configure"
+#line 2140 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2187,12 +2172,12 @@ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
 strdup strtoul tsearch __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2191: checking for $ac_func" >&5
+echo "configure:2176: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2196 "configure"
+#line 2181 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2215,7 +2200,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2255,7 +2240,7 @@ fi
 
 
   echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:2259: checking for iconv" >&5
+echo "configure:2244: checking for iconv" >&5
 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2263,7 +2248,7 @@ else
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     cat > conftest.$ac_ext <<EOF
-#line 2267 "configure"
+#line 2252 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -2273,7 +2258,7 @@ iconv_t cd = iconv_open("","");
        iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_func_iconv=yes
 else
@@ -2285,7 +2270,7 @@ rm -f conftest*
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -liconv"
       cat > conftest.$ac_ext <<EOF
-#line 2289 "configure"
+#line 2274 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -2295,7 +2280,7 @@ iconv_t cd = iconv_open("","");
          iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_lib_iconv=yes
         am_cv_func_iconv=yes
@@ -2316,13 +2301,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
 EOF
 
     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:2320: checking for iconv declaration" >&5
+echo "configure:2305: checking for iconv declaration" >&5
     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
       cat > conftest.$ac_ext <<EOF
-#line 2326 "configure"
+#line 2311 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -2341,7 +2326,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_proto_iconv_arg1=""
 else
@@ -2370,19 +2355,19 @@ EOF
 
    
   echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:2374: checking for nl_langinfo and CODESET" >&5
+echo "configure:2359: checking for nl_langinfo and CODESET" >&5
 if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2379 "configure"
+#line 2364 "configure"
 #include "confdefs.h"
 #include <langinfo.h>
 int main() {
 char* cs = nl_langinfo(CODESET);
 ; return 0; }
 EOF
-if { (eval echo configure:2386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_langinfo_codeset=yes
 else
@@ -2405,19 +2390,19 @@ EOF
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2409: checking for LC_MESSAGES" >&5
+echo "configure:2394: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2414 "configure"
+#line 2399 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:2421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -2438,7 +2423,7 @@ EOF
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2442: checking whether NLS is requested" >&5
+echo "configure:2427: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -2460,7 +2445,7 @@ fi
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2464: checking whether included gettext is requested" >&5
+echo "configure:2449: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -2480,17 +2465,17 @@ fi
 
        ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2484: checking for libintl.h" >&5
+echo "configure:2469: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2489 "configure"
+#line 2474 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2507,12 +2492,12 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:2511: checking for GNU gettext in libc" >&5
+echo "configure:2496: checking for GNU gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2516 "configure"
+#line 2501 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 extern int _nl_msg_cat_cntr;
@@ -2521,7 +2506,7 @@ bindtextdomain ("", "");
 return (int) gettext ("") + _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gnugettext1_libc=yes
 else
@@ -2537,14 +2522,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
 
           if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
             echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:2541: checking for GNU gettext in libintl" >&5
+echo "configure:2526: checking for GNU gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   gt_save_LIBS="$LIBS"
                LIBS="$LIBS -lintl $LIBICONV"
                cat > conftest.$ac_ext <<EOF
-#line 2548 "configure"
+#line 2533 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 extern int _nl_msg_cat_cntr;
@@ -2553,7 +2538,7 @@ bindtextdomain ("", "");
 return (int) gettext ("") + _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gnugettext1_libintl=yes
 else
@@ -2586,12 +2571,12 @@ EOF
             for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2590: checking for $ac_func" >&5
+echo "configure:2575: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2595 "configure"
+#line 2580 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2614,7 +2599,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2643,7 +2628,7 @@ done
                     # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2647: checking for $ac_word" >&5
+echo "configure:2632: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2677,7 +2662,7 @@ fi
             # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2681: checking for $ac_word" >&5
+echo "configure:2666: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2714,7 +2699,7 @@ fi
                     # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2718: checking for $ac_word" >&5
+echo "configure:2703: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2764,7 +2749,7 @@ fi
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2768: checking for $ac_word" >&5
+echo "configure:2753: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2798,7 +2783,7 @@ fi
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2802: checking for $ac_word" >&5
+echo "configure:2787: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2834,7 +2819,7 @@ fi
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2838: checking for $ac_word" >&5
+echo "configure:2823: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2905,7 +2890,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2909: checking for $ac_word" >&5
+echo "configure:2894: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2938,7 +2923,7 @@ done
       ac_verc_fail=yes
     else
             echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:2942: checking version of bison" >&5
+echo "configure:2927: checking version of bison" >&5
       ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
       case $ac_prog_version in
         '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -2985,7 +2970,7 @@ echo "configure:2942: checking version of bison" >&5
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2989: checking for catalogs to be installed" >&5
+echo "configure:2974: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for presentlang in $ALL_LINGUAS; do
          useit=no
@@ -3037,7 +3022,7 @@ echo "configure:2989: checking for catalogs to be installed" >&5
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3041: checking for a BSD compatible install" >&5
+echo "configure:3026: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3108,7 +3093,7 @@ case x"${target_os}" in
     # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ac_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3112: checking for $ac_word" >&5
+echo "configure:3097: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3140,7 +3125,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3144: checking for $ac_word" >&5
+echo "configure:3129: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3195,12 +3180,12 @@ esac
 for ac_func in gettimeofday select strerror strtod strtol isatty
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3199: checking for $ac_func" >&5
+echo "configure:3184: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3204 "configure"
+#line 3189 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3223,7 +3208,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3248,12 +3233,12 @@ fi
 done
 
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3252: checking for connect" >&5
+echo "configure:3237: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3257 "configure"
+#line 3242 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -3276,7 +3261,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -3295,7 +3280,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3299: checking for connect in -lsocket" >&5
+echo "configure:3284: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3303,7 +3288,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3307 "configure"
+#line 3292 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3314,7 +3299,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3339,12 +3324,12 @@ fi
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3343: checking for gethostbyname" >&5
+echo "configure:3328: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3348 "configure"
+#line 3333 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3367,7 +3352,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3386,7 +3371,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3390: checking for gethostbyname in -lnsl" >&5
+echo "configure:3375: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3394,7 +3379,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3398 "configure"
+#line 3383 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3405,7 +3390,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3429,12 +3414,12 @@ fi
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3433: checking for gethostbyname" >&5
+echo "configure:3418: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3438 "configure"
+#line 3423 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3457,7 +3442,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3476,7 +3461,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for gethostbyname in -lbind""... $ac_c" 1>&6
-echo "configure:3480: checking for gethostbyname in -lbind" >&5
+echo "configure:3465: checking for gethostbyname in -lbind" >&5
 ac_lib_var=`echo bind'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3484,7 +3469,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3488 "configure"
+#line 3473 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3495,7 +3480,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3519,12 +3504,12 @@ fi
 fi
 
 echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
-echo "configure:3523: checking for nanosleep" >&5
+echo "configure:3508: checking for nanosleep" >&5
 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3528 "configure"
+#line 3513 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char nanosleep(); below.  */
@@ -3547,7 +3532,7 @@ nanosleep();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_nanosleep=yes"
 else
@@ -3566,7 +3551,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
-echo "configure:3570: checking for nanosleep in -lrt" >&5
+echo "configure:3555: checking for nanosleep in -lrt" >&5
 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3574,7 +3559,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3578 "configure"
+#line 3563 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3585,7 +3570,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:3589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3605,7 +3590,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
-echo "configure:3609: checking for nanosleep in -lposix4" >&5
+echo "configure:3594: checking for nanosleep in -lposix4" >&5
 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3613,7 +3598,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3617 "configure"
+#line 3602 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3624,7 +3609,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3653,12 +3638,12 @@ fi
 for ac_func in usleep
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3657: checking for $ac_func" >&5
+echo "configure:3642: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3662 "configure"
+#line 3647 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3681,7 +3666,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3706,12 +3691,12 @@ fi
 done
 
 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:3710: checking for inet_aton" >&5
+echo "configure:3695: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3715 "configure"
+#line 3700 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -3734,7 +3719,7 @@ inet_aton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -3753,7 +3738,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:3757: checking for inet_aton in -lresolv" >&5
+echo "configure:3742: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3761,7 +3746,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3765 "configure"
+#line 3750 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3772,7 +3757,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:3776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3796,12 +3781,12 @@ fi
 fi
 
 echo $ac_n "checking for textdomain""... $ac_c" 1>&6
-echo "configure:3800: checking for textdomain" >&5
+echo "configure:3785: checking for textdomain" >&5
 if eval "test \"`echo '$''{'ac_cv_func_textdomain'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3805 "configure"
+#line 3790 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char textdomain(); below.  */
@@ -3824,7 +3809,7 @@ textdomain();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_textdomain=yes"
 else
@@ -3843,7 +3828,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for textdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3847: checking for textdomain in -lintl" >&5
+echo "configure:3832: checking for textdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'textdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3851,7 +3836,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3855 "configure"
+#line 3840 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3862,7 +3847,7 @@ int main() {
 textdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3888,12 +3873,12 @@ fi
 for ac_func in vasprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3892: checking for $ac_func" >&5
+echo "configure:3877: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3897 "configure"
+#line 3882 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3916,7 +3901,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3943,12 +3928,12 @@ done
 for ac_func in swab
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3947: checking for $ac_func" >&5
+echo "configure:3932: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3952 "configure"
+#line 3937 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3971,7 +3956,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3998,12 +3983,12 @@ done
 for ac_func in memalign valloc
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4002: checking for $ac_func" >&5
+echo "configure:3987: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4007 "configure"
+#line 3992 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4026,7 +4011,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4054,12 +4039,12 @@ done
 for ac_func in sigrelse
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4058: checking for $ac_func" >&5
+echo "configure:4043: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4063 "configure"
+#line 4048 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4082,7 +4067,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4109,12 +4094,12 @@ done
 for ac_func in getpwuid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4113: checking for $ac_func" >&5
+echo "configure:4098: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4118 "configure"
+#line 4103 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4137,7 +4122,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4164,12 +4149,12 @@ done
 
 NEED_GETOPT=0
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:4168: checking for getopt_long" >&5
+echo "configure:4153: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4173 "configure"
+#line 4158 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -4192,7 +4177,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -4214,7 +4199,7 @@ else
   echo "$ac_t""no" 1>&6
  # FreeBSD has a gnugetopt library for this:
   echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:4218: checking for getopt_long in -lgnugetopt" >&5
+echo "configure:4203: checking for getopt_long in -lgnugetopt" >&5
 ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4222,7 +4207,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgnugetopt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4226 "configure"
+#line 4211 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4233,7 +4218,7 @@ int main() {
 getopt_long()
 ; return 0; }
 EOF
-if { (eval echo configure:4237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4261,12 +4246,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4265: checking return type of signal handlers" >&5
+echo "configure:4250: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4270 "configure"
+#line 4255 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -4283,7 +4268,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:4287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -4302,7 +4287,7 @@ EOF
 
 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4306: checking for dlopen in -ldl" >&5
+echo "configure:4291: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4310,7 +4295,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4314 "configure"
+#line 4299 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4321,7 +4306,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4342,7 +4327,7 @@ else
 fi
 
 echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
-echo "configure:4346: checking for cos in -lm" >&5
+echo "configure:4331: checking for cos in -lm" >&5
 ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4350,7 +4335,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4354 "configure"
+#line 4339 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4361,7 +4346,7 @@ int main() {
 cos()
 ; return 0; }
 EOF
-if { (eval echo configure:4365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4383,7 +4368,7 @@ else
 fi
 
 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:4387: checking for pow in -lm" >&5
+echo "configure:4372: checking for pow in -lm" >&5
 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4391,7 +4376,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4395 "configure"
+#line 4380 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4402,7 +4387,7 @@ int main() {
 pow()
 ; return 0; }
 EOF
-if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4430,7 +4415,7 @@ fi
 THREAD_LIB=error
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
-echo "configure:4434: checking for pthread_attr_init in -lpthread" >&5
+echo "configure:4419: checking for pthread_attr_init in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4438,7 +4423,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4442 "configure"
+#line 4427 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4449,7 +4434,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4472,7 +4457,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
-echo "configure:4476: checking for pthread_attr_init in -lpthreads" >&5
+echo "configure:4461: checking for pthread_attr_init in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4480,7 +4465,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4484 "configure"
+#line 4469 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4491,7 +4476,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:4495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4514,7 +4499,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
-echo "configure:4518: checking for pthread_attr_init in -lc_r" >&5
+echo "configure:4503: checking for pthread_attr_init in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4522,7 +4507,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4526 "configure"
+#line 4511 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4533,7 +4518,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4556,12 +4541,12 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
-echo "configure:4560: checking for pthread_attr_init" >&5
+echo "configure:4545: checking for pthread_attr_init" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4565 "configure"
+#line 4550 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_attr_init(); below.  */
@@ -4584,7 +4569,7 @@ pthread_attr_init();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_attr_init=yes"
 else
@@ -4607,7 +4592,7 @@ fi
 fi
 
 echo $ac_n "checking for cthread_fork in -lthreads""... $ac_c" 1>&6
-echo "configure:4611: checking for cthread_fork in -lthreads" >&5
+echo "configure:4596: checking for cthread_fork in -lthreads" >&5
 ac_lib_var=`echo threads'_'cthread_fork | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4615,7 +4600,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4619 "configure"
+#line 4604 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4626,7 +4611,7 @@ int main() {
 cthread_fork()
 ; return 0; }
 EOF
-if { (eval echo configure:4630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4648,7 +4633,7 @@ fi
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4652 "configure"
+#line 4637 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -4664,7 +4649,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 4668 "configure"
+#line 4653 "configure"
 #include "confdefs.h"
 #include <strings.h>
 EOF
@@ -4684,17 +4669,17 @@ for ac_hdr in getopt.h strings.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4688: checking for $ac_hdr" >&5
+echo "configure:4673: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4693 "configure"
+#line 4678 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4724,17 +4709,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h sys/times.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4728: checking for $ac_hdr" >&5
+echo "configure:4713: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4733 "configure"
+#line 4718 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4764,17 +4749,17 @@ for ac_hdr in dlfcn.h image.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4768: checking for $ac_hdr" >&5
+echo "configure:4753: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4773 "configure"
+#line 4758 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4804,17 +4789,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4808: checking for $ac_hdr" >&5
+echo "configure:4793: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4813 "configure"
+#line 4798 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4844,17 +4829,17 @@ for ac_hdr in machine/param.h sys/shm.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4848: checking for $ac_hdr" >&5
+echo "configure:4833: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4853 "configure"
+#line 4838 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4882,12 +4867,12 @@ done
 
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4886: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4871: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4891 "configure"
+#line 4876 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4896,7 +4881,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4921,17 +4906,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4925: checking for $ac_hdr" >&5
+echo "configure:4910: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4930 "configure"
+#line 4915 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4972,17 +4957,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4976: checking for $ac_hdr" >&5
+echo "configure:4961: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4981 "configure"
+#line 4966 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5004,7 +4989,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
     cat > conftest.$ac_ext <<EOF
-#line 5008 "configure"
+#line 4993 "configure"
 #include "confdefs.h"
 #include <X11/extensions/dpms.h>
 EOF
@@ -5030,20 +5015,20 @@ done
 fi
 
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:5034: checking for ntohl in sys/param.h" >&5
+echo "configure:5019: checking for ntohl in sys/param.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_ntohl_sys_param_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -Wall -Werror"
      cat > conftest.$ac_ext <<EOF
-#line 5040 "configure"
+#line 5025 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 int main() {
 void foo() { int meuh; ntohl(meuh); }
 ; return 0; }
 EOF
-if { (eval echo configure:5047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_ntohl_sys_param_h=yes
 else
@@ -5064,20 +5049,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6
-echo "configure:5068: checking if \$CC accepts -finline-limit" >&5
+echo "configure:5053: checking if \$CC accepts -finline-limit" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline_limit'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -finline-limit-30000"
      cat > conftest.$ac_ext <<EOF
-#line 5074 "configure"
+#line 5059 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline_limit=yes
 else
@@ -5095,20 +5080,20 @@ if test x"$ac_cv_c_inline_limit" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -Wall -Winline""... $ac_c" 1>&6
-echo "configure:5099: checking if \$CC accepts -Wall -Winline" >&5
+echo "configure:5084: checking if \$CC accepts -Wall -Winline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_Wall_Winline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -Wall -Winline"
      cat > conftest.$ac_ext <<EOF
-#line 5105 "configure"
+#line 5090 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_Wall_Winline=yes
 else
@@ -5125,20 +5110,20 @@ if test x"$ac_cv_c_Wall_Winline" != x"no"; then
     save_CFLAGS="${save_CFLAGS} -Wall -Winline"
 else
     echo $ac_n "checking if \$CC accepts -wall -winline""... $ac_c" 1>&6
-echo "configure:5129: checking if \$CC accepts -wall -winline" >&5
+echo "configure:5114: checking if \$CC accepts -wall -winline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_wall_winline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -wall -winline"
          cat > conftest.$ac_ext <<EOF
-#line 5135 "configure"
+#line 5120 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_wall_winline=yes
 else
@@ -5157,20 +5142,20 @@ echo "$ac_t""$ac_cv_c_wall_winline" 1>&6
 fi
 
 echo $ac_n "checking if \$CC accepts -pipe""... $ac_c" 1>&6
-echo "configure:5161: checking if \$CC accepts -pipe" >&5
+echo "configure:5146: checking if \$CC accepts -pipe" >&5
 if eval "test \"`echo '$''{'ac_cv_c_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -pipe"
      cat > conftest.$ac_ext <<EOF
-#line 5167 "configure"
+#line 5152 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_pipe=yes
 else
@@ -5188,20 +5173,20 @@ if test x"$ac_cv_c_pipe" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -O3""... $ac_c" 1>&6
-echo "configure:5192: checking if \$CC accepts -O3" >&5
+echo "configure:5177: checking if \$CC accepts -O3" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o3'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O3"
      cat > conftest.$ac_ext <<EOF
-#line 5198 "configure"
+#line 5183 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o3=yes
 else
@@ -5218,20 +5203,20 @@ if test x"$ac_cv_c_o3" != x"no"; then
     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
 else
     echo $ac_n "checking if \$CC accepts -O2""... $ac_c" 1>&6
-echo "configure:5222: checking if \$CC accepts -O2" >&5
+echo "configure:5207: checking if \$CC accepts -O2" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O2"
          cat > conftest.$ac_ext <<EOF
-#line 5228 "configure"
+#line 5213 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o2=yes
 else
@@ -5248,20 +5233,20 @@ echo "$ac_t""$ac_cv_c_o2" 1>&6
         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
     else
         echo $ac_n "checking if \$CC accepts -O""... $ac_c" 1>&6
-echo "configure:5252: checking if \$CC accepts -O" >&5
+echo "configure:5237: checking if \$CC accepts -O" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O"
              cat > conftest.$ac_ext <<EOF
-#line 5258 "configure"
+#line 5243 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o=yes
 else
@@ -5281,20 +5266,20 @@ echo "$ac_t""$ac_cv_c_o" 1>&6
 fi
 
 echo $ac_n "checking if \$CC accepts -ffast-math""... $ac_c" 1>&6
-echo "configure:5285: checking if \$CC accepts -ffast-math" >&5
+echo "configure:5270: checking if \$CC accepts -ffast-math" >&5
 if eval "test \"`echo '$''{'ac_cv_c_fast_math'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -ffast-math"
      cat > conftest.$ac_ext <<EOF
-#line 5291 "configure"
+#line 5276 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_fast_math=yes
 else
@@ -5312,20 +5297,20 @@ if test x"$ac_cv_c_fast_math" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -funroll-loops""... $ac_c" 1>&6
-echo "configure:5316: checking if \$CC accepts -funroll-loops" >&5
+echo "configure:5301: checking if \$CC accepts -funroll-loops" >&5
 if eval "test \"`echo '$''{'ac_cv_c_unroll_loops'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -funroll-loops"
      cat > conftest.$ac_ext <<EOF
-#line 5322 "configure"
+#line 5307 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_unroll_loops=yes
 else
@@ -5343,20 +5328,20 @@ if test x"$ac_cv_c_unroll_loops" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -fomit-frame-pointer""... $ac_c" 1>&6
-echo "configure:5347: checking if \$CC accepts -fomit-frame-pointer" >&5
+echo "configure:5332: checking if \$CC accepts -fomit-frame-pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_c_omit_frame_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
      cat > conftest.$ac_ext <<EOF
-#line 5353 "configure"
+#line 5338 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_omit_frame_pointer=yes
 else
@@ -5374,20 +5359,20 @@ if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -bundle -undefined error -lcc_dynamic""... $ac_c" 1>&6
-echo "configure:5378: checking if \$CC accepts -bundle -undefined error -lcc_dynamic" >&5
+echo "configure:5363: checking if \$CC accepts -bundle -undefined error -lcc_dynamic" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_darwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
      cat > conftest.$ac_ext <<EOF
-#line 5384 "configure"
+#line 5369 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_darwin=yes
 else
@@ -5405,20 +5390,20 @@ if test x"$ac_cv_ld_darwin" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
-echo "configure:5409: checking if \$CC accepts -shared" >&5
+echo "configure:5394: checking if \$CC accepts -shared" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -shared"
      cat > conftest.$ac_ext <<EOF
-#line 5415 "configure"
+#line 5400 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_plugins=yes
 else
@@ -5435,73 +5420,8 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
     PLDFLAGS="${PLDFLAGS} -shared"
 fi
         
-if test x"${SOFLAGS}" = x; then
-    echo $ac_n "checking for soname setting""... $ac_c" 1>&6
-echo "configure:5441: checking for soname setting" >&5
-if eval "test \"`echo '$''{'ac_cv_ld_soname'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-        # Standard
-        try_SOFLAGS="-Wl,-soname -Wl,"
-        LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
-        cat > conftest.$ac_ext <<EOF
-#line 5450 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:5457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_ld_soname="${try_SOFLAGS}"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-            # SunOS
-            try_SOFLAGS="-Wl,-h -Wl,"
-            LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
-            cat > conftest.$ac_ext <<EOF
-#line 5469 "configure"
-#include "confdefs.h"
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:5476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_ld_soname="${try_SOFLAGS}"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_ld_soname=none
-fi
-rm -f conftest*
-        
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_ld_soname" 1>&6
-    if test x"$ac_cv_ld_soname" != x"none"; then
-        SOFLAGS=$ac_cv_ld_soname
-    else
-        echo "
-------------
-Your system doesn't seem to have support for dynamic linking. You may
-have problems using libdvdcss.
-------------
-"
-    fi
-fi
-
 echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
-echo "configure:5505: checking __attribute__ ((aligned ())) support" >&5
+echo "configure:5425: checking __attribute__ ((aligned ())) support" >&5
 if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5509,14 +5429,14 @@ else
         CFLAGS="${save_CFLAGS} -Werror"
     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
         cat > conftest.$ac_ext <<EOF
-#line 5513 "configure"
+#line 5433 "configure"
 #include "confdefs.h"
 
 int main() {
 static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;
 ; return 0; }
 EOF
-if { (eval echo configure:5520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try
 else
@@ -5539,19 +5459,19 @@ CFLAGS="${save_CFLAGS}"
 LDFLAGS="${save_LDFLAGS}"
 
 echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:5543: checking for boolean_t in sys/types.h" >&5
+echo "configure:5463: checking for boolean_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_boolean_t_sys_types_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5548 "configure"
+#line 5468 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 boolean_t foo;
 ; return 0; }
 EOF
-if { (eval echo configure:5555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_boolean_t_sys_types_h=yes
 else
@@ -5572,19 +5492,19 @@ EOF
 fi
 
 echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
-echo "configure:5576: checking for boolean_t in pthread.h" >&5
+echo "configure:5496: checking for boolean_t in pthread.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_boolean_t_pthread_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5581 "configure"
+#line 5501 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 int main() {
 boolean_t foo;
 ; return 0; }
 EOF
-if { (eval echo configure:5588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_boolean_t_pthread_h=yes
 else
@@ -5605,19 +5525,19 @@ EOF
 fi
 
 echo $ac_n "checking for boolean_t in cthreads.h""... $ac_c" 1>&6
-echo "configure:5609: checking for boolean_t in cthreads.h" >&5
+echo "configure:5529: checking for boolean_t in cthreads.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_boolean_t_cthreads_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5614 "configure"
+#line 5534 "configure"
 #include "confdefs.h"
 #include <cthreads.h>
 int main() {
 boolean_t foo;
 ; return 0; }
 EOF
-if { (eval echo configure:5621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_boolean_t_cthreads_h=yes
 else
@@ -5658,19 +5578,19 @@ fi
 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
 
 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:5662: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:5582: checking if \$CC groks MMX inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5667 "configure"
+#line 5587 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmx_inline=yes
 else
@@ -5688,19 +5608,19 @@ if test x"$ac_cv_mmx_inline" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6
-echo "configure:5692: checking if \$CC groks MMX EXT inline assembly" >&5
+echo "configure:5612: checking if \$CC groks MMX EXT inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5697 "configure"
+#line 5617 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmxext_inline=yes
 else
@@ -5718,19 +5638,19 @@ if test x"$ac_cv_mmxext_inline" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6
-echo "configure:5722: checking if \$CC groks 3D Now! inline assembly" >&5
+echo "configure:5642: checking if \$CC groks 3D Now! inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5727 "configure"
+#line 5647 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_3dnow_inline=yes
 else
@@ -5752,19 +5672,19 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6
-echo "configure:5756: checking if \$CC groks SSE inline assembly" >&5
+echo "configure:5676: checking if \$CC groks SSE inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5761 "configure"
+#line 5681 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sse_inline=yes
 else
@@ -5789,19 +5709,19 @@ fi
 # we should be able to remove this test with future versions of mingw32
 if test x$SYS != xmingw32; then
 echo $ac_n "checking if \$CC groks Altivec inline assembly""... $ac_c" 1>&6
-echo "configure:5793: checking if \$CC groks Altivec inline assembly" >&5
+echo "configure:5713: checking if \$CC groks Altivec inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5798 "configure"
+#line 5718 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline=yes
 else
@@ -5811,14 +5731,14 @@ else
   save_CFLAGS=$CFLAGS
           CFLAGS="$CFLAGS -Wa,-m7400"
           cat > conftest.$ac_ext <<EOF
-#line 5815 "configure"
+#line 5735 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline="-Wa,-m7400"
 else
@@ -5849,7 +5769,7 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks Altivec C extensions""... $ac_c" 1>&6
-echo "configure:5853: checking if \$CC groks Altivec C extensions" >&5
+echo "configure:5773: checking if \$CC groks Altivec C extensions" >&5
 if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5857,14 +5777,14 @@ else
      CFLAGS="$CFLAGS -faltivec"
      # Darwin test
      cat > conftest.$ac_ext <<EOF
-#line 5861 "configure"
+#line 5781 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec=-faltivec
 else
@@ -5875,14 +5795,14 @@ else
         # Linux/PPC test
         CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec"
         cat > conftest.$ac_ext <<EOF
-#line 5879 "configure"
+#line 5799 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec="-fvec"
 else
@@ -5912,21 +5832,21 @@ EOF
 fi
 
 echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6
-echo "configure:5916: checking if linker needs -framework vecLib" >&5
+echo "configure:5836: checking if linker needs -framework vecLib" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   save_LDFLAGS=$LDFLAGS
      LDFLAGS="$LDFLAGS -framework vecLib"
      cat > conftest.$ac_ext <<EOF
-#line 5923 "configure"
+#line 5843 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_altivec=yes
 else
 fi # end if mingw32
 
 
+# Check whether --with- or --without- was given.
+if test "${with_+set}" = set; then
+  withval="$with_"
+  :
+fi
 
-CAN_BUILD_LIBDVDCSS=0
+# Check whether --with- or --without- was given.
+if test "${with_+set}" = set; then
+  withval="$with_"
+  :
+fi
 
-for ac_hdr in winioctl.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5960: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+# Check whether --with-tuning or --without-tuning was given.
+if test "${with_tuning+set}" = set; then
+  withval="$with_tuning"
+  :
+fi
+
+if test "x$withval" != "x"; then
+    TUNING=$withval
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5965 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+    if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
+    else
+        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
+    fi
+fi
+
+if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
+then
+    ARCH="${ARCH} mmx"
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
+fi
+
+# Check whether --enable-optimizations or --disable-optimizations was given.
+if test "${enable_optimizations+set}" = set; then
+  enableval="$enable_optimizations"
+   if test x$enableval = xno; then OPTIMS=0; fi 
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+   OPTIMS=1 
 fi
-rm -f conftest*
+
+
+# Check whether --enable-altivec or --disable-altivec was given.
+if test "${enable_altivec+set}" = set; then
+  enableval="$enable_altivec"
+   if test x$enableval = xyes; then ARCH="${ARCH} altivec";
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+else
+   if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+fi
+
+
+DEBUG=0
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+   if test x$enableval = xyes; then DEBUG=1; fi 
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
 
+
+# Check whether --enable-release or --disable-release was given.
+if test "${enable_release+set}" = set; then
+  enableval="$enable_release"
+   if test x$enableval = xyes; then RELEASE=1; fi 
 else
-  echo "$ac_t""no" 1>&6
+   VERSION="${VERSION}_`date +%Y-%m-%d`" 
+fi
+
+
+
+# Check whether --with- or --without- was given.
+if test "${with_+set}" = set; then
+  withval="$with_"
+  :
+fi
+
+
+# Check whether --enable-dvd or --disable-dvd was given.
+if test "${enable_dvd+set}" = set; then
+  enableval="$enable_dvd"
+  :
 fi
-done
 
+if test "x$enableval" != "xno"
+then
+  # Check whether --with-dvdcss or --without-dvdcss was given.
+if test "${with_dvdcss+set}" = set; then
+  withval="$with_dvdcss"
+  :
+fi
 
-for ac_hdr in sys/ioctl.h
+  case "x$with_dvdcss" in
+  x)
+    for ac_hdr in dvdcss/dvdcss.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6003: checking for $ac_hdr" >&5
+echo "configure:5972: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6008 "configure"
+#line 5977 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6029,23 +5998,67 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
-  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
-  for ac_hdr in sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h
+  PLUGINS="${PLUGINS} dvd"
+        LIB_DVD="${LIB_DVD} -ldvdcss" 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  ;;
+  xno)
+    PLUGINS="${PLUGINS} dvd"
+    CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
+    LIB_DVD="${LIB_DVD} -ldl"
+  ;;
+  *)
+    echo $ac_n "checking for dvdcss headers in ${withval}""... $ac_c" 1>&6
+echo "configure:6017: checking for dvdcss headers in ${withval}" >&5
+    if test -f ${withval}/include/dvdcss/dvdcss.h
+    then
+      echo "$ac_t""yes" 1>&6
+      PLUGINS="${PLUGINS} dvd"
+      LIB_DVD="${LIB_DVD} -L${withval}/lib -ldvd"
+      CFLAGS_DVD="${CFLAGS_DVD} -I${withval}/include"
+    else
+      echo "$ac_t""no" 1>&6
+      { echo "configure: error: Cannot find ${withval}/dvdcss/dvdcss.h" 1>&2; exit 1; }
+    fi
+  ;;
+  esac
+fi
+
+# Check whether --enable-dvdread or --disable-dvdread was given.
+if test "${enable_dvdread+set}" = set; then
+  enableval="$enable_dvdread"
+  :
+fi
+
+if test "x$enableval" != "xno"
+then
+  # Check whether --with-dvdread or --without-dvdread was given.
+if test "${with_dvdread+set}" = set; then
+  withval="$with_dvdread"
+  :
+fi
+
+  case "x$with_dvdread" in
+  x)
+    for ac_hdr in dvdread/dvd_reader.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6039: checking for $ac_hdr" >&5
+echo "configure:6052: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6044 "configure"
+#line 6057 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6065,544 +6078,50 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
+  PLUGINS="${PLUGINS} dvdread"
+        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread" 
 else
   echo "$ac_t""no" 1>&6
 fi
 done
 
-  BSD_DVD_STRUCT=0
-  LINUX_DVD_STRUCT=0
-  OPENBSD_DVD_STRUCT=0
-        cat > conftest.$ac_ext <<EOF
-#line 6079 "configure"
-#include "confdefs.h"
-#include <sys/cdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "dvd_struct" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-    cat >> confdefs.h <<\EOF
-#define DVD_STRUCT_IN_SYS_CDIO_H 1
-EOF
-
-    cat > conftest.$ac_ext <<EOF
-#line 6092 "configure"
-#include "confdefs.h"
-#include <sys/cdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "struct dvd_struct" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-                    BSD_DVD_STRUCT=1
-else
-  rm -rf conftest*
-  LINUX_DVD_STRUCT=1; OPENBSD_DVD_STRUCT=1
-fi
-rm -f conftest*
-
-  
+  ;;
+  *)
+    echo $ac_n "checking for dvdread headers in ${withval}""... $ac_c" 1>&6
+echo "configure:6092: checking for dvdread headers in ${withval}" >&5
+    if test -f ${withval}/include/dvdread/dvd_reader.h
+    then
+      echo "$ac_t""yes" 1>&6
+      PLUGINS="${PLUGINS} dvdread"
+      LIB_DVDREAD="${LIB_DVDREAD} -L${withval}/lib -ldvdread"
+      CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I${withval}/include"
+    else
+      echo "$ac_t""no" 1>&6
+      { echo "configure: error: Cannot find ${withval}/dvdread/dvd_reader.h" 1>&2; exit 1; }
+    fi
+  ;;
+  esac
 fi
-rm -f conftest*
-
-        cat > conftest.$ac_ext <<EOF
-#line 6112 "configure"
-#include "confdefs.h"
-#include <sys/dvdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "dvd_struct" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-    cat >> confdefs.h <<\EOF
-#define DVD_STRUCT_IN_SYS_DVDIO_H 1
-EOF
 
-    cat > conftest.$ac_ext <<EOF
-#line 6125 "configure"
-#include "confdefs.h"
-#include <sys/dvdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "struct dvd_struct" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-                    BSD_DVD_STRUCT=1
-else
-  rm -rf conftest*
-  LINUX_DVD_STRUCT=1
+# Check whether --enable-vcd or --disable-vcd was given.
+if test "${enable_vcd+set}" = set; then
+  enableval="$enable_vcd"
+  :
 fi
-rm -f conftest*
 
-  
-fi
-rm -f conftest*
 
-        cat > conftest.$ac_ext <<EOF
-#line 6145 "configure"
+if test x$enable_vcd != xno
+then
+  cat > conftest.$ac_ext <<EOF
+#line 6117 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "dvd_struct" >/dev/null 2>&1; then
+  egrep "cdrom_msf0" >/dev/null 2>&1; then
   rm -rf conftest*
   
-    cat >> confdefs.h <<\EOF
-#define DVD_STRUCT_IN_LINUX_CDROM_H 1
-EOF
-
-    LINUX_DVD_STRUCT=1
-  
-fi
-rm -f conftest*
-
-        NEED_BSDI_LIBDVD=0
-  cat > conftest.$ac_ext <<EOF
-#line 6164 "configure"
-#include "confdefs.h"
-#include <dvd.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "dvd_struct" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-    cat >> confdefs.h <<\EOF
-#define DVD_STRUCT_IN_DVD_H 1
-EOF
-
-    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
-    LINUX_DVD_STRUCT=1
-  
-else
-  rm -rf conftest*
-  
-                for ac_hdr in /sys/dev/scsi/scsi_ioctl.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6186: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6191 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-      NEED_BSDI_LIBDVD=1
-      cat >> confdefs.h <<\EOF
-#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1
-EOF
-
-      SRC_DVDCSS_EXTRA="${SRC_DVDCSS_EXTRA} bsdi_dvdioctl.c"
-      LINUX_DVD_STRUCT=1
-    
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-  
-fi
-rm -f conftest*
-
-        ac_safe=`echo "sys/scsi/scsi_types.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/scsi/scsi_types.h""... $ac_c" 1>&6
-echo "configure:6236: checking for sys/scsi/scsi_types.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6241 "configure"
-#include "confdefs.h"
-#include <sys/scsi/scsi_types.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-    ac_safe=`echo "sys/scsi/impl/uscsi.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/scsi/impl/uscsi.h""... $ac_c" 1>&6
-echo "configure:6265: checking for sys/scsi/impl/uscsi.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6270 "configure"
-#include "confdefs.h"
-#include <sys/scsi/impl/uscsi.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-      cat >> confdefs.h <<\EOF
-#define SOLARIS_USCSI 1
-EOF
-
-    
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-  
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-        ac_safe=`echo "sys/scsi.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/scsi.h""... $ac_c" 1>&6
-echo "configure:6308: checking for sys/scsi.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6313 "configure"
-#include "confdefs.h"
-#include <sys/scsi.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-    cat > conftest.$ac_ext <<EOF
-#line 6336 "configure"
-#include "confdefs.h"
-#include <sys/scsi.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "sctl_io" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-      cat >> confdefs.h <<\EOF
-#define HPUX_SCTL_IO 1
-EOF
-
-    
-fi
-rm -f conftest*
-
-  
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-        if test x$LINUX_DVD_STRUCT = x1; then
-    cat >> confdefs.h <<\EOF
-#define HAVE_LINUX_DVD_STRUCT 1
-EOF
-
-    if test x$OPENBSD_DVD_STRUCT = x1; then
-      cat >> confdefs.h <<\EOF
-#define HAVE_OPENBSD_DVD_STRUCT 1
-EOF
-
-    fi
-  else
-    if test x$BSD_DVD_STRUCT = x1; then
-      cat >> confdefs.h <<\EOF
-#define HAVE_BSD_DVD_STRUCT 1
-EOF
-
-    fi
-  fi
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-# Check whether --with- or --without- was given.
-if test "${with_+set}" = set; then
-  withval="$with_"
-  :
-fi
-
-# Check whether --with- or --without- was given.
-if test "${with_+set}" = set; then
-  withval="$with_"
-  :
-fi
-
-
-# Check whether --with-tuning or --without-tuning was given.
-if test "${with_tuning+set}" = set; then
-  withval="$with_tuning"
-  :
-fi
-
-if test "x$withval" != "x"; then
-    TUNING=$withval
-else
-    if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
-    else
-        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
-    fi
-fi
-
-if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
-then
-    ARCH="${ARCH} mmx"
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
-fi
-
-# Check whether --enable-optimizations or --disable-optimizations was given.
-if test "${enable_optimizations+set}" = set; then
-  enableval="$enable_optimizations"
-   if test x$enableval = xno; then OPTIMS=0; fi 
-else
-   OPTIMS=1 
-fi
-
-
-# Check whether --enable-altivec or --disable-altivec was given.
-if test "${enable_altivec+set}" = set; then
-  enableval="$enable_altivec"
-   if test x$enableval = xyes; then ARCH="${ARCH} altivec";
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
-else
-   if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
-fi
-
-
-DEBUG=0
-# Check whether --enable-debug or --disable-debug was given.
-if test "${enable_debug+set}" = set; then
-  enableval="$enable_debug"
-   if test x$enableval = xyes; then DEBUG=1; fi 
-fi
-
-
-# Check whether --enable-release or --disable-release was given.
-if test "${enable_release+set}" = set; then
-  enableval="$enable_release"
-   if test x$enableval = xyes; then RELEASE=1; fi 
-else
-   VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
-  LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; 
-fi
-
-
-
-# Check whether --with- or --without- was given.
-if test "${with_+set}" = set; then
-  withval="$with_"
-  :
-fi
-
-
-NEED_LIBDVDCSS=0
-STATIC_LIBDVDCSS=0
-DUMMY_LIBDVDCSS=0
-# Check whether --with-dvdcss or --without-dvdcss was given.
-if test "${with_dvdcss+set}" = set; then
-  withval="$with_dvdcss"
-   case "x${withval}" in
-    xlocal-static|xyes)
-      # local libdvdcss, statically linked
-      BUILTINS="${BUILTINS} dvd"
-      if test x${CAN_BUILD_LIBDVDCSS} = x1
-      then
-        NEED_LIBDVDCSS=1
-        STATIC_LIBDVDCSS=1
-        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-        LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-      fi
-    ;;
-    xlocal-shared)
-      # local libdvdcss, dynamically linked
-      PLUGINS="${PLUGINS} dvd"
-      if test x${CAN_BUILD_LIBDVDCSS} = x1
-      then
-        NEED_LIBDVDCSS=1
-        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-        LIB_DVD="${LIB_DVD} -L../../lib -ldvdcss"
-      fi
-    ;;
-    xno)
-      # don't use libdvdcss at all, build a DVD module that can dlopen() it
-      PLUGINS="${PLUGINS} dvd"
-      DUMMY_LIBDVDCSS=1
-      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
-      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
-      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
-      LIB_DVD="${LIB_DVD} -ldl"
-    ;;
-    *)
-      # existing libdvdcss
-      PLUGINS="${PLUGINS} dvd"
-      if test "x$withval" != "xyes"
-      then
-        LIB_DVD="${LIB_DVD} -L"$withval"/lib"
-        CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
-      fi
-      LIB_DVD="${LIB_DVD} -ldvdcss"
-    esac 
-else
-  # user didn't decide, we choose to use local libdvdcss and link statically
-  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
-   if test x${CAN_BUILD_LIBDVDCSS} = x1
-    then
-      BUILTINS="${BUILTINS} dvd"
-      NEED_LIBDVDCSS=1
-      STATIC_LIBDVDCSS=1
-      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-      LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-    else
-      # XXX: no check for libdl is done, don't try this at home !
-      PLUGINS="${PLUGINS} dvd"
-      DUMMY_LIBDVDCSS=1
-      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
-      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
-      LIB_DVD="${LIB_DVD} -ldl"
-    fi 
-fi
-
-
-if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
-if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
-# Check whether --with-dvdread or --without-dvdread was given.
-if test "${with_dvdread+set}" = set; then
-  withval="$with_dvdread"
-   case "x${withval}" in
-    xlocal-static|xyes)
-      if test x${STATIC_LIBDVDREAD} = x1
-      then
-        BUILTINS="${BUILTINS} dvdread" 
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
-        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
-      else
-        { echo "configure: error: Can't link static dvdread with shared dvdcss" 1>&2; exit 1; }
-      fi
-    ;;
-    xno)
-    ;;
-    x)
-      if test x${STATIC_LIBDVDREAD} = x1
-      then
-        #BUILTINS="${BUILTINS} dvdread" 
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
-        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
-      else
-        #PLUGINS="${PLUGINS} dvdread"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread  ${CFLAGS_DVD}"
-        LIB_DVDREAD="${LIB_DVDREAD} -Llib -ldvdread ${LIB_DVD}"
-      fi 
-    ;;
-    *)
-      if test "x$withval" != "xlocal-shared"
-      then
-        LIB_DVDREAD="${LIB_DVDREAD} -L"$withval"/lib"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I"$withval"/include"
-      else
-        LIB_DVDREAD="${LIB_DVDREAD} -L../../lib"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
-      fi
-      if test x${STATIC_LIBDVDCSS} = x1
-      then
-        { echo "configure: error: Can't link shared dvdread with static dvdcss" 1>&2; exit 1; }
-      else
-        #PLUGINS="${PLUGINS} dvdread"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD}"
-        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread ${LIB_DVD}"
-      fi
-    esac
-    if test x${DUMMY_LIBDVDCSS} = x1
-    then
-      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -ldl"
-    else
-      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -L../../lib -ldvdcss"
-    fi 
-fi
-
-
-# Check whether --enable-vcd or --disable-vcd was given.
-if test "${enable_vcd+set}" = set; then
-  enableval="$enable_vcd"
-  :
-fi
-
-
-if test x$enable_vcd != xno
-then
-  cat > conftest.$ac_ext <<EOF
-#line 6598 "configure"
-#include "confdefs.h"
-#include <linux/cdrom.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "cdrom_msf0" >/dev/null 2>&1; then
-  rm -rf conftest*
-  
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} vcd"
   
 fi
 rm -f conftest*
@@ -6635,12 +6154,12 @@ fi
 
 
 echo $ac_n "checking for inet_pton""... $ac_c" 1>&6
-echo "configure:6639: checking for inet_pton" >&5
+echo "configure:6158: checking for inet_pton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_pton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6644 "configure"
+#line 6163 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_pton(); below.  */
@@ -6663,7 +6182,7 @@ inet_pton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_pton=yes"
 else
@@ -6719,17 +6238,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6723: checking for $ac_hdr" >&5
+echo "configure:6242: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6728 "configure"
+#line 6247 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6759,7 +6278,7 @@ fi
 done
 
   echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6763: checking for mad_bit_init in -lmad" >&5
+echo "configure:6282: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6767,7 +6286,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6771 "configure"
+#line 6290 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6778,7 +6297,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6830,17 +6349,17 @@ if test "x$enableval" != "xno" -a x$SYS != xmingw32
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6834: checking for $ac_hdr" >&5
+echo "configure:6353: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6839 "configure"
+#line 6358 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6899,17 +6418,17 @@ if test x$enable_x11 != xno &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6903: checking for $ac_hdr" >&5
+echo "configure:6422: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6908 "configure"
+#line 6427 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6962,17 +6481,17 @@ if test x$enable_xvideo != xno &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6966: checking for $ac_hdr" >&5
+echo "configure:6485: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6971 "configure"
+#line 6490 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6996,7 +6515,7 @@ EOF
     saved_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
     echo $ac_n "checking for XvSetPortAttribute in -lXv_pic""... $ac_c" 1>&6
-echo "configure:7000: checking for XvSetPortAttribute in -lXv_pic" >&5
+echo "configure:6519: checking for XvSetPortAttribute in -lXv_pic" >&5
 ac_lib_var=`echo Xv_pic'_'XvSetPortAttribute | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7004,7 +6523,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv_pic  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7008 "configure"
+#line 6527 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7015,7 +6534,7 @@ int main() {
 XvSetPortAttribute()
 ; return 0; }
 EOF
-if { (eval echo configure:7019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7073,7 +6592,7 @@ fi
   # Extract the first word of "sdl12-config", so it can be a program name with args.
 set dummy sdl12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7077: checking for $ac_word" >&5
+echo "configure:6596: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7113,7 +6632,7 @@ fi
     # Extract the first word of "sdl11-config", so it can be a program name with args.
 set dummy sdl11-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7117: checking for $ac_word" >&5
+echo "configure:6636: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7154,7 +6673,7 @@ fi
     # Extract the first word of "sdl-config", so it can be a program name with args.
 set dummy sdl-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7158: checking for $ac_word" >&5
+echo "configure:6677: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7200,17 +6719,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7204: checking for $ac_hdr" >&5
+echo "configure:6723: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7209 "configure"
+#line 6728 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7280,17 +6799,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7284: checking for $ac_hdr" >&5
+echo "configure:6803: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7289 "configure"
+#line 6808 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7319,7 +6838,7 @@ done
 
     else
       echo $ac_n "checking for directX headers in ${withval}""... $ac_c" 1>&6
-echo "configure:7323: checking for directX headers in ${withval}" >&5
+echo "configure:6842: checking for directX headers in ${withval}" >&5
       if test -f ${withval}/ddraw.h
       then
         PLUGINS="${PLUGINS} directx"
@@ -7346,17 +6865,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7350: checking for $ac_hdr" >&5
+echo "configure:6869: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7355 "configure"
+#line 6874 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7451,17 +6970,17 @@ if test x$enable_aa = xyes
 then
   ac_safe=`echo "aalib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for aalib.h""... $ac_c" 1>&6
-echo "configure:7455: checking for aalib.h" >&5
+echo "configure:6974: checking for aalib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7460 "configure"
+#line 6979 "configure"
 #include "confdefs.h"
 #include <aalib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7512,17 +7031,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7516: checking for $ac_hdr" >&5
+echo "configure:7035: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7521 "configure"
+#line 7040 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7545,7 +7064,7 @@ EOF
  
     PLUGINS="${PLUGINS} dsp"
     echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:7549: checking for main in -lossaudio" >&5
+echo "configure:7068: checking for main in -lossaudio" >&5
 ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7553,14 +7072,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lossaudio  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7557 "configure"
+#line 7076 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7596,7 +7115,7 @@ if test "${enable_esd+set}" = set; then
      # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7600: checking for $ac_word" >&5
+echo "configure:7119: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7647,7 +7166,7 @@ if test "${enable_arts+set}" = set; then
      # Extract the first word of "artsc-config", so it can be a program name with args.
 set dummy artsc-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7651: checking for $ac_word" >&5
+echo "configure:7170: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7697,17 +7216,17 @@ if test "${enable_alsa+set}" = set; then
    then
      ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
-echo "configure:7701: checking for alsa/asoundlib.h" >&5
+echo "configure:7220: checking for alsa/asoundlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7706 "configure"
+#line 7225 "configure"
 #include "confdefs.h"
 #include <alsa/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7724,7 +7243,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:7728: checking for main in -lasound" >&5
+echo "configure:7247: checking for main in -lasound" >&5
 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7732,14 +7251,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7736 "configure"
+#line 7255 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7816,7 +7335,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7820: checking for $ac_word" >&5
+echo "configure:7339: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7855,7 +7374,7 @@ fi
     # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7859: checking for $ac_word" >&5
+echo "configure:7378: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7905,17 +7424,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7909: checking for $ac_hdr" >&5
+echo "configure:7428: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7914 "configure"
+#line 7433 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7961,7 +7480,7 @@ if test "${enable_gnome+set}" = set; then
     # Extract the first word of "gnome-config", so it can be a program name with args.
 set dummy gnome-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7965: checking for $ac_word" >&5
+echo "configure:7484: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8006,17 +7525,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8010: checking for $ac_hdr" >&5
+echo "configure:7529: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8015 "configure"
+#line 7534 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8106,17 +7625,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8110: checking for $ac_hdr" >&5
+echo "configure:7629: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8115 "configure"
+#line 7634 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8161,17 +7680,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8165: checking for $ac_hdr" >&5
+echo "configure:7684: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8170 "configure"
+#line 7689 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8232,17 +7751,17 @@ if test x$enable_lirc = xyes
 then
   ac_safe=`echo "lirc/lirc_client.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lirc/lirc_client.h""... $ac_c" 1>&6
-echo "configure:8236: checking for lirc/lirc_client.h" >&5
+echo "configure:7755: checking for lirc/lirc_client.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8241 "configure"
+#line 7760 "configure"
 #include "confdefs.h"
 #include <lirc/lirc_client.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8259,7 +7778,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:8263: checking for lirc_init in -llirc_client" >&5
+echo "configure:7782: checking for lirc_init in -llirc_client" >&5
 ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8267,7 +7786,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llirc_client  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8271 "configure"
+#line 7790 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8278,7 +7797,7 @@ int main() {
 lirc_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8335,7 +7854,7 @@ fi
       ;;
     *)
                   echo $ac_n "checking whether the byte order is big-endian""... $ac_c" 1>&6
-echo "configure:8339: checking whether the byte order is big-endian" >&5
+echo "configure:7858: checking whether the byte order is big-endian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8420,7 +7939,7 @@ if test "${enable_pth+set}" = set; then
   enableval="$enable_pth"
    if test x$enableval = xyes; then
     echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
-echo "configure:8424: checking for pth_init in -lpth" >&5
+echo "configure:7943: checking for pth_init in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8428,7 +7947,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8432 "configure"
+#line 7951 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8439,7 +7958,7 @@ int main() {
 pth_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8467,7 +7986,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 8471 "configure"
+#line 7990 "configure"
 #include "confdefs.h"
 #include <pth.h>
 EOF
@@ -8493,7 +8012,7 @@ if test "${enable_st+set}" = set; then
   enableval="$enable_st"
    if test x$enableval = xyes; then
     echo $ac_n "checking for st_init in -lst""... $ac_c" 1>&6
-echo "configure:8497: checking for st_init in -lst" >&5
+echo "configure:8016: checking for st_init in -lst" >&5
 ac_lib_var=`echo st'_'st_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8501,7 +8020,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lst  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8505 "configure"
+#line 8024 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8512,7 +8031,7 @@ int main() {
 st_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8540,7 +8059,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 8544 "configure"
+#line 8063 "configure"
 #include "confdefs.h"
 #include <st.h>
 EOF
@@ -8583,15 +8102,15 @@ then
 fi
 
 cat >> confdefs.h <<EOF
-#define VERSION_MESSAGE "vlc $VLC_VERSION $VLC_CODENAME Copyright 1996-2001 VideoLAN\n"
+#define VERSION_MESSAGE "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN\n"
 EOF
 
 cat >> confdefs.h <<EOF
-#define COPYRIGHT_MESSAGE "VideoLAN Client - version $VLC_VERSION $VLC_CODENAME - (c) 1996-2002 VideoLAN"
+#define COPYRIGHT_MESSAGE "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN"
 EOF
 
 
-VLC_SYMBOL="`echo ${VLC_VERSION} | tr .- __`"
+VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
 cat >> confdefs.h <<EOF
 #define MODULE_SUFFIX "__MODULE_$VLC_SYMBOL"
 EOF
@@ -8687,14 +8206,6 @@ PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
 
 
 
-
-
-
-
-
-
-
-
 
 
 
@@ -8852,7 +8363,6 @@ s%@build_alias@%$build_alias%g
 s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
-s%@LIBDVDCSS_VERSION@%$LIBDVDCSS_VERSION%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
@@ -8912,7 +8422,6 @@ s%@DLL_PATH@%$DLL_PATH%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@PLDFLAGS@%$PLDFLAGS%g
-s%@SOFLAGS@%$SOFLAGS%g
 s%@LIB_COMMON@%$LIB_COMMON%g
 s%@LIB_VLC@%$LIB_VLC%g
 s%@LIB_A52@%$LIB_A52%g
@@ -8939,8 +8448,6 @@ s%@LIB_IMDCTSSE@%$LIB_IMDCTSSE%g
 s%@LIB_IPV4@%$LIB_IPV4%g
 s%@LIB_IPV6@%$LIB_IPV6%g
 s%@LIB_KDE@%$LIB_KDE%g
-s%@LIB_LIBDVDCSS@%$LIB_LIBDVDCSS%g
-s%@LIB_LIBDVDREAD@%$LIB_LIBDVDREAD%g
 s%@LIB_LIRC@%$LIB_LIRC%g
 s%@LIB_MACOSX@%$LIB_MACOSX%g
 s%@LIB_MAD@%$LIB_MAD%g
@@ -8967,7 +8474,6 @@ s%@CFLAGS_GNOME@%$CFLAGS_GNOME%g
 s%@CFLAGS_GTK@%$CFLAGS_GTK%g
 s%@CFLAGS_KDE@%$CFLAGS_KDE%g
 s%@CFLAGS_IDCTALTIVEC@%$CFLAGS_IDCTALTIVEC%g
-s%@CFLAGS_LIBDVDCSS@%$CFLAGS_LIBDVDCSS%g
 s%@CFLAGS_MACOSX@%$CFLAGS_MACOSX%g
 s%@CFLAGS_MAD@%$CFLAGS_MAD%g
 s%@CFLAGS_MOTIONALTIVEC@%$CFLAGS_MOTIONALTIVEC%g
@@ -8978,10 +8484,7 @@ s%@CFLAGS_SDL@%$CFLAGS_SDL%g
 s%@CFLAGS_WIN32@%$CFLAGS_WIN32%g
 s%@CFLAGS_X11@%$CFLAGS_X11%g
 s%@CFLAGS_XVIDEO@%$CFLAGS_XVIDEO%g
-s%@SRC_DVD_EXTRA@%$SRC_DVD_EXTRA%g
-s%@SRC_DVDCSS_EXTRA@%$SRC_DVDCSS_EXTRA%g
 s%@NEED_GETOPT@%$NEED_GETOPT%g
-s%@NEED_LIBDVDCSS@%$NEED_LIBDVDCSS%g
 
 CEOF
 EOF
@@ -9233,52 +8736,24 @@ test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
 
 echo "
-global configuration
+vlc configuration
 --------------------
+vlc version           : ${VERSION}
 system                : ${SYS}
 architecture          : ${ARCH}
 optimizations         : ${OPTIMS}
-tuning:               : ${TUNING}
-release:              : ${RELEASE}"
-
-if test x${HAVE_VLC} = x1
-then
-  echo "
-vlc configuration
------------------
-vlc version           : ${VLC_VERSION}
+tuning                : ${TUNING}
 debug mode            : ${DEBUG}
+release               : ${RELEASE}
 cprof/gprof support   : ${CPROF}/${GPROF}
 need builtin getopt   : ${NEED_GETOPT}
 built-in modules      :${BUILTINS}
 plug-in modules       :${PLUGINS}
-vlc aliases           :${ALIASES}"
-fi
+vlc aliases           :${ALIASES}
 
-echo "
-libdvdcss configuration
------------------------
-can be built          : ${CAN_BUILD_LIBDVDCSS}
-will be built         : ${NEED_LIBDVDCSS}"
-if test x${NEED_LIBDVDCSS} = x1
-then
-  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
-  echo "link statically       : ${STATIC_LIBDVDCSS}"
-else
-  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
-fi
-
-echo "
 You may now tune Makefile.opts at your convenience, for instance to choose
 which modules get compiled as plugins.
+
+To build vlc and its plugins, type \`$VLC_MAKE'.
 "
-if test x${HAVE_VLC} = x1
-then
-  echo "To build vlc and its plugins, type \`$VLC_MAKE'."
-fi
-if test x${NEED_LIBDVDCSS} = x1
-then
-  echo "To build libdvdcss only, type \`$VLC_MAKE libdvdcss'."
-fi
-echo ""
 
index 4075383a26f0fd0824c34693f3ec2a129aa2bb5c..9cd6c7638653cc0cb85af9d16843d6db1fd36ee2 100644 (file)
@@ -1,25 +1,11 @@
-dnl Autoconf settings for vlc and libdvdcss
+dnl Autoconf settings for vlc
 AC_INIT(include/main.h)
 AC_CONFIG_HEADER(include/defs.h)
 
 AC_CANONICAL_SYSTEM
 
-HAVE_VLC=0
-if test -r src/interface/main.c; then
-  HAVE_VLC=1
-  VLC_VERSION="0.2.92-dev"
-  VLC_CODENAME=Ourumov
-fi
-
-HAVE_LIBDVDCSS=0
-if test -r extras/libdvdcss/libdvdcss.c; then
-  HAVE_LIBDVDCSS=1
-  LIBDVDCSS_VERSION="1.0.1-dev"
-  AC_SUBST(LIBDVDCSS_VERSION)
-  if test -r extras/libdvdcss/csskeys.h; then
-    AC_DEFINE(HAVE_CSSKEYS,1,css decryption with player keys)
-  fi
-fi
+VERSION="0.2.92-dev"
+CODENAME=Ourumov
 
 dnl Save CFLAGS and LDFLAGS
 save_CFLAGS="${CFLAGS}"
@@ -53,8 +39,8 @@ fi
 dnl Gettext stuff
 ALL_LINGUAS="de fr ja no ru nl"
 
-AC_DEFINE_UNQUOTED(PACKAGE, "vlc")
-AC_DEFINE_UNQUOTED(VERSION, "$VLC_VERSION")
+AC_DEFINE_UNQUOTED(PACKAGE, "vlc", [Package name])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version])
 AM_GNU_GETTEXT
 
 dnl AM_PROG_LIBTOOL
@@ -326,33 +312,6 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
     PLDFLAGS="${PLDFLAGS} -shared"
 fi
         
-dnl Check for soname setting
-if test x"${SOFLAGS}" = x; then
-    AC_CACHE_CHECK([for soname setting],
-        [ac_cv_ld_soname],
-        [
-        # Standard
-        try_SOFLAGS="-Wl,-soname -Wl,"
-        LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
-        AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
-            # SunOS
-            try_SOFLAGS="-Wl,-h -Wl,"
-            LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
-            AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
-                ac_cv_ld_soname=none)
-        ])])
-    if test x"$ac_cv_ld_soname" != x"none"; then
-        SOFLAGS=$ac_cv_ld_soname
-    else
-        echo "
-------------
-Your system doesn't seem to have support for dynamic linking. You may
-have problems using libdvdcss.
-------------
-"
-    fi
-fi
-
 dnl Checks for __attribute__(aligned()) directive
 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
     [ac_cv_c_attribute_aligned],
@@ -521,106 +480,6 @@ fi
 fi # end if mingw32
 
 
-dnl
-dnl  libdvdcss: check for DVD ioctls
-dnl
-
-dnl  default is no
-CAN_BUILD_LIBDVDCSS=0
-
-dnl  for windoze
-AC_CHECK_HEADERS(winioctl.h,[
-  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
-])
-
-dnl  for Un*x and BeOS
-AC_CHECK_HEADERS(sys/ioctl.h,[
-  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
-  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
-  BSD_DVD_STRUCT=0
-  LINUX_DVD_STRUCT=0
-  OPENBSD_DVD_STRUCT=0
-  dnl
-  dnl Old FreeBSD: sys/cdio.h
-  dnl
-  AC_EGREP_HEADER(dvd_struct,sys/cdio.h,[
-    AC_DEFINE(DVD_STRUCT_IN_SYS_CDIO_H, 1,
-              Define if <sys/cdio.h> defines dvd_struct.)
-    AC_EGREP_HEADER(struct dvd_struct,sys/cdio.h,[
-                    BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1; OPENBSD_DVD_STRUCT=1])
-  ])
-  dnl
-  dnl Newer FreeBSD: sys/dvdio.h
-  dnl
-  AC_EGREP_HEADER(dvd_struct,sys/dvdio.h,[
-    AC_DEFINE(DVD_STRUCT_IN_SYS_DVDIO_H, 1,
-              Define if <sys/dvdio.h> defines dvd_struct.)
-    AC_EGREP_HEADER(struct dvd_struct,sys/dvdio.h,[
-                    BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1])
-  ])
-  dnl
-  dnl Linux: linux/cdrom.h
-  dnl
-  AC_EGREP_HEADER(dvd_struct,linux/cdrom.h,[
-    AC_DEFINE(DVD_STRUCT_IN_LINUX_CDROM_H, 1,
-              Define if <linux/cdrom.h> defines DVD_STRUCT.)
-    LINUX_DVD_STRUCT=1
-  ])
-  dnl
-  dnl BSDI: dvd.h
-  dnl
-  NEED_BSDI_LIBDVD=0
-  AC_EGREP_HEADER(dvd_struct,dvd.h,[
-    AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
-              Define if <dvd.h> defines DVD_STRUCT.)
-    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
-    LINUX_DVD_STRUCT=1
-  ],[
-    dnl
-    dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
-    dnl
-    AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
-      NEED_BSDI_LIBDVD=1
-      AC_DEFINE(DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H, 1,
-                Define if <extras/BSDI_dvdioctl/dvd.h> defines DVD_STRUCT.)
-      SRC_DVDCSS_EXTRA="${SRC_DVDCSS_EXTRA} bsdi_dvdioctl.c"
-      LINUX_DVD_STRUCT=1
-    ])
-  ])
-  dnl
-  dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
-  dnl
-  AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
-    AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
-      AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
-    ])
-  ])
-  dnl
-  dnl HP-UX: sys/scsi.h
-  dnl
-  AC_CHECK_HEADER(sys/scsi.h,[
-    AC_EGREP_HEADER(sctl_io,sys/scsi.h,[
-      AC_DEFINE(HPUX_SCTL_IO, 1, Define if <sys/scsi.h> defines sctl_io.)
-    ])
-  ])
-  dnl
-  dnl Final tests to check what was detected
-  dnl
-  if test x$LINUX_DVD_STRUCT = x1; then
-    AC_DEFINE(HAVE_LINUX_DVD_STRUCT, 1,
-              Define if Linux-like dvd_struct is defined.)
-    if test x$OPENBSD_DVD_STRUCT = x1; then
-      AC_DEFINE(HAVE_OPENBSD_DVD_STRUCT, 1,
-                Define if OpenBSD-like dvd_struct is defined.)
-    fi
-  else
-    if test x$BSD_DVD_STRUCT = x1; then
-      AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
-                Define if FreeBSD-like dvd_struct is defined.)
-    fi
-  fi
-])
-
 AC_ARG_WITH(,[])
 AC_ARG_WITH(,[Optimization options:])
 
@@ -680,8 +539,7 @@ dnl
 AC_ARG_ENABLE(release,
 [  --enable-release        activate extra optimizations (default disabled)],
 [ if test x$enableval = xyes; then RELEASE=1; fi ],
-[ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
-  LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
+[ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
 
 dnl
 dnl  Input plugins
@@ -690,136 +548,77 @@ dnl
 AC_ARG_WITH(,[Input plugins:])
 
 dnl
-dnl  DVD module: check for installed libdvdcss or local libdvdcss
-dnl
-NEED_LIBDVDCSS=0
-STATIC_LIBDVDCSS=0
-DUMMY_LIBDVDCSS=0
-AC_ARG_WITH(dvdcss,
-  [  --with-dvdcss[=name]    use libdvdcss, either 'yes', 'no', 'local-static',
-                          'local-shared', or a path to another libdvdcss such
-                          as '/usr/local' (default 'local-static')],
-  [ case "x${withval}" in
-    xlocal-static|xyes)
-      # local libdvdcss, statically linked
-      BUILTINS="${BUILTINS} dvd"
-      if test x${CAN_BUILD_LIBDVDCSS} = x1
-      then
-        NEED_LIBDVDCSS=1
-        STATIC_LIBDVDCSS=1
-        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-        LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-      fi
-    ;;
-    xlocal-shared)
-      # local libdvdcss, dynamically linked
-      PLUGINS="${PLUGINS} dvd"
-      if test x${CAN_BUILD_LIBDVDCSS} = x1
-      then
-        NEED_LIBDVDCSS=1
-        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-        LIB_DVD="${LIB_DVD} -L../../lib -ldvdcss"
-      fi
-    ;;
-    xno)
-      # don't use libdvdcss at all, build a DVD module that can dlopen() it
-      PLUGINS="${PLUGINS} dvd"
-      DUMMY_LIBDVDCSS=1
-      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
-      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
-      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
-      LIB_DVD="${LIB_DVD} -ldl"
-    ;;
-    *)
-      # existing libdvdcss
-      PLUGINS="${PLUGINS} dvd"
-      if test "x$withval" != "xyes"
-      then
-        LIB_DVD="${LIB_DVD} -L"$withval"/lib"
-        CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
-      fi
-      LIB_DVD="${LIB_DVD} -ldvdcss"
-    esac ],
-  # user didn't decide, we choose to use local libdvdcss and link statically
-  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
-  [ if test x${CAN_BUILD_LIBDVDCSS} = x1
+dnl  DVD module: optionally check for installed libdvdcss
+dnl
+AC_ARG_ENABLE(dvd,
+[  --enable-dvd            DVD input module (default enabled)])
+if test "x$enableval" != "xno"
+then
+  AC_ARG_WITH(dvdcss, 
+  [    --with-dvdcss=PATH    libdvdcss headers and libraries])
+  case "x$with_dvdcss" in
+  x)
+    AC_CHECK_HEADERS(dvdcss/dvdcss.h,
+      [ PLUGINS="${PLUGINS} dvd"
+        LIB_DVD="${LIB_DVD} -ldvdcss" ])
+  ;;
+  xno)
+    PLUGINS="${PLUGINS} dvd"
+    CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
+    LIB_DVD="${LIB_DVD} -ldl"
+  ;;
+  *)
+    AC_MSG_CHECKING(for dvdcss headers in ${withval})
+    if test -f ${withval}/include/dvdcss/dvdcss.h
     then
-      BUILTINS="${BUILTINS} dvd"
-      NEED_LIBDVDCSS=1
-      STATIC_LIBDVDCSS=1
-      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-      LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-    else
-      # XXX: no check for libdl is done, don't try this at home !
+      AC_MSG_RESULT(yes)
       PLUGINS="${PLUGINS} dvd"
-      DUMMY_LIBDVDCSS=1
-      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
-      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
-      LIB_DVD="${LIB_DVD} -ldl"
-    fi ])
+      LIB_DVD="${LIB_DVD} -L${withval}/lib -ldvd"
+      CFLAGS_DVD="${CFLAGS_DVD} -I${withval}/include"
+    else
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([Cannot find ${withval}/dvdcss/dvdcss.h])
+    fi
+  ;;
+  esac
+fi
 
 dnl
-dnl DVDREAD module: check for libdvdread plugin
+dnl dvdread module: check for libdvdread plugin
 dnl
-if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
-if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
-AC_ARG_WITH(dvdread,
-  [  --with-dvdread[=name]   use libdvdread, same options as dvdcss (default 'no')],
-  [ case "x${withval}" in
-    xlocal-static|xyes)
-      if test x${STATIC_LIBDVDREAD} = x1
-      then
-        BUILTINS="${BUILTINS} dvdread" 
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
-        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
-      else
-        AC_MSG_ERROR([Can't link static dvdread with shared dvdcss])
-      fi
-    ;;
-    xno)
-    ;;
-    x)
-      if test x${STATIC_LIBDVDREAD} = x1
-      then
-        #BUILTINS="${BUILTINS} dvdread" 
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
-        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
-      else
-        #PLUGINS="${PLUGINS} dvdread"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread  ${CFLAGS_DVD}"
-        LIB_DVDREAD="${LIB_DVDREAD} -Llib -ldvdread ${LIB_DVD}"
-      fi 
-    ;;
-    *)
-      if test "x$withval" != "xlocal-shared"
-      then
-        LIB_DVDREAD="${LIB_DVDREAD} -L"$withval"/lib"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I"$withval"/include"
-      else
-        LIB_DVDREAD="${LIB_DVDREAD} -L../../lib"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
-      fi
-      if test x${STATIC_LIBDVDCSS} = x1
-      then
-        AC_MSG_ERROR([Can't link shared dvdread with static dvdcss])
-      else
-        #PLUGINS="${PLUGINS} dvdread"
-        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD}"
-        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread ${LIB_DVD}"
-      fi
-    esac
-    if test x${DUMMY_LIBDVDCSS} = x1
+AC_ARG_ENABLE(dvdread,
+[  --enable-dvdread        dvdread input module (default disabled)])
+if test "x$enableval" != "xno"
+then
+  AC_ARG_WITH(dvdread, 
+  [    --with-dvdread=PATH   libdvdread headers and libraries])
+  case "x$with_dvdread" in
+  x)
+    AC_CHECK_HEADERS(dvdread/dvd_reader.h,
+      [ PLUGINS="${PLUGINS} dvdread"
+        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread" ])
+  ;;
+  *)
+    AC_MSG_CHECKING(for dvdread headers in ${withval})
+    if test -f ${withval}/include/dvdread/dvd_reader.h
     then
-      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -ldl"
+      AC_MSG_RESULT(yes)
+      PLUGINS="${PLUGINS} dvdread"
+      LIB_DVDREAD="${LIB_DVDREAD} -L${withval}/lib -ldvdread"
+      CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I${withval}/include"
     else
-      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -L../../lib -ldvdcss"
-    fi ])
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([Cannot find ${withval}/dvdread/dvd_reader.h])
+    fi
+  ;;
+  esac
+fi
 
 dnl
 dnl  VCD module
 dnl
 AC_ARG_ENABLE(vcd,
-  [  --enable-vcd            VCD support for Linux (default enabled)])
+  [  --enable-vcd            VCD support for Linux and MacOS X (default enabled)])
 
 if test x$enable_vcd != xno
 then
@@ -843,7 +642,7 @@ dnl
 dnl  Satellite input module
 dnl
 AC_ARG_ENABLE(satellite,
-  [  --enable-satellite       Satellite card support (default disabled)],
+  [  --enable-satellite      satellite card support (default disabled)],
   [ if test x$enable_satellite = xyes
     then
       BUILTINS="${BUILTINS} satellite"
@@ -1548,12 +1347,12 @@ fi
 dnl
 dnl  Stuff used by the program
 dnl
-AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VLC_VERSION $VLC_CODENAME Copyright 1996-2001 VideoLAN\n")
-AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VLC_VERSION $VLC_CODENAME - (c) 1996-2002 VideoLAN")
+AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN\n", [Simple version string])
+AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN", [Copyright string])
 
-VLC_SYMBOL="`echo ${VLC_VERSION} | tr .- __`"
-AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL")
-AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL)
+VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
+AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL", [String suffix for module functions])
+AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL, [Symbol suffix for module functions])
 
 DATA_PATH="${ac_tool_prefix}/share/videolan"
 AC_SUBST(DATA_PATH)
@@ -1584,7 +1383,6 @@ AC_SUBST(VERSION)
 
 AC_SUBST(LDFLAGS)
 AC_SUBST(PLDFLAGS)
-AC_SUBST(SOFLAGS)
 
 AC_SUBST(LIB_COMMON)
 AC_SUBST(LIB_VLC)
@@ -1613,8 +1411,6 @@ AC_SUBST(LIB_IMDCTSSE)
 AC_SUBST(LIB_IPV4)
 AC_SUBST(LIB_IPV6)
 AC_SUBST(LIB_KDE)
-AC_SUBST(LIB_LIBDVDCSS)
-AC_SUBST(LIB_LIBDVDREAD)
 AC_SUBST(LIB_LIRC)
 AC_SUBST(LIB_MACOSX)
 AC_SUBST(LIB_MAD)
@@ -1643,7 +1439,6 @@ AC_SUBST(CFLAGS_GNOME)
 AC_SUBST(CFLAGS_GTK)
 AC_SUBST(CFLAGS_KDE)
 AC_SUBST(CFLAGS_IDCTALTIVEC)
-AC_SUBST(CFLAGS_LIBDVDCSS)
 AC_SUBST(CFLAGS_MACOSX)
 AC_SUBST(CFLAGS_MAD)
 AC_SUBST(CFLAGS_MOTIONALTIVEC)
@@ -1655,61 +1450,29 @@ AC_SUBST(CFLAGS_WIN32)
 AC_SUBST(CFLAGS_X11)
 AC_SUBST(CFLAGS_XVIDEO)
 
-AC_SUBST(SRC_DVD_EXTRA)
-AC_SUBST(SRC_DVDCSS_EXTRA)
-
 AC_SUBST(NEED_GETOPT)
-AC_SUBST(NEED_LIBDVDCSS)
 
 AC_OUTPUT([Makefile.opts po/Makefile.in])
 
 echo "
-global configuration
+vlc configuration
 --------------------
+vlc version           : ${VERSION}
 system                : ${SYS}
 architecture          : ${ARCH}
 optimizations         : ${OPTIMS}
-tuning:               : ${TUNING}
-release:              : ${RELEASE}"
-
-if test x${HAVE_VLC} = x1
-then
-  echo "
-vlc configuration
------------------
-vlc version           : ${VLC_VERSION}
+tuning                : ${TUNING}
 debug mode            : ${DEBUG}
+release               : ${RELEASE}
 cprof/gprof support   : ${CPROF}/${GPROF}
 need builtin getopt   : ${NEED_GETOPT}
 built-in modules      :${BUILTINS}
 plug-in modules       :${PLUGINS}
-vlc aliases           :${ALIASES}"
-fi
+vlc aliases           :${ALIASES}
 
-echo "
-libdvdcss configuration
------------------------
-can be built          : ${CAN_BUILD_LIBDVDCSS}
-will be built         : ${NEED_LIBDVDCSS}"
-if test x${NEED_LIBDVDCSS} = x1
-then
-  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
-  echo "link statically       : ${STATIC_LIBDVDCSS}"
-else
-  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
-fi
-
-echo "
 You may now tune Makefile.opts at your convenience, for instance to choose
 which modules get compiled as plugins.
+
+To build vlc and its plugins, type \`$VLC_MAKE'.
 "
-if test x${HAVE_VLC} = x1
-then
-  echo "To build vlc and its plugins, type \`$VLC_MAKE'."
-fi
-if test x${NEED_LIBDVDCSS} = x1
-then
-  echo "To build libdvdcss only, type \`$VLC_MAKE libdvdcss'."
-fi
-echo ""
 
index 38b6d247d6488f21e6d0b2b4446277f22cd71f7d..ac42c955c17cab1d2d23532d81fe72e4a59aa4a2 100644 (file)
@@ -1,7 +1,6 @@
 tmp
 vlc
 vlc-*
-libdvdcss*
 delete
 files
 *debhelper
index 971090fb7b9f3e6d814129ffa6998b12dca891bb..d733974d8fcf4277dae1ab8ab20a4c166e227942 100644 (file)
@@ -30,27 +30,6 @@ Description: a free MPEG and DVD player
  This is vlc, the VideoLAN Client. It plays MPEG and MPEG2 files,
  DVDs, or MPEG streams from a network source.
 
-Package: libdvdcss1
-Architecture: any
-Depends: ${shlibs:Depends}
-Conflicts: libdvdcss0.0.1, libdvdcss0.0.2, libdvdcss0.0.3
-Description: a portable abstraction library for DVD decryption
- libdvdcss is a portable abstraction library for DVD decryption, it
- provides a simple API to access a DVD device as a block device.
- .
- This package contains the libdvdcss1 runtime library.
-
-Package: libdvdcss1-dev
-Architecture: any
-Depends: libdvdcss1 (= ${Source-Version}), libc6-dev
-Conflicts: libdvdcss0.0.1-dev, libdvdcss0.0.2-dev, libdvdcss0.0.3-dev
-Description: development files for libdvdcss1
- libdvdcss is a portable abstraction library for DVD decryption, it
- provides a simple API to access a DVD device as a block device.
- .
- This package contains the header files and static library needed to
- compile applications that use libdvdcss1.
-
 Package: vlc-gnome
 Architecture: any
 Depends: vlc (= ${Source-Version}), ${shlibs:Depends}
diff --git a/debian/libdvdcss1-dev.dirs b/debian/libdvdcss1-dev.dirs
deleted file mode 100644 (file)
index 42d13c0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/include/videolan
-usr/lib
-usr/share/doc
diff --git a/debian/libdvdcss1.copyright b/debian/libdvdcss1.copyright
deleted file mode 100644 (file)
index 30917be..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-This package was debianized by Samuel Hocevar <sam@zoy.org> on
-Mon, 13 Mar 2000 02:21:45 +0100.
-
-It was taken from the CVS tree. See http://www.videolan.org/cvs.html
-
-Upstream Authors: The VideoLAN Team <videolan@videolan.org>
-
-VideoLAN is Copyright 1996, 1997, 1998, 1999, 2000, 2001 The VideoLAN Team
-
-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, 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, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
-
-On Debian GNU/Linux systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
diff --git a/debian/libdvdcss1.dirs b/debian/libdvdcss1.dirs
deleted file mode 100644 (file)
index fe6300c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib
-usr/share/doc/libdvdcss1
diff --git a/debian/libdvdcss1.docs b/debian/libdvdcss1.docs
deleted file mode 100644 (file)
index e5695c7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-AUTHORS
-README.libdvdcss
-TODO
index 910d6159351f8a090929a78b3e5a7bd4b734c5a2..82162a4f8dd148bff21258a62c9d6fdfde841a51 100755 (executable)
@@ -10,15 +10,11 @@ export DH_COMPAT=3
 
 # Compilation options
 export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-kde --enable-aa"
-export LIBDVDCSS_FLAGS="--with-dvdcss=local-shared"
+export DVDCSS_FLAGS="--enable-dvd"
 export VIDDIR="usr/share/videolan"
 export PIXDIR="usr/share/pixmaps"
 export GNOMEDIR="usr/share/gnome/apps/Multimedia"
 
-# Library options
-version=$(shell grep '^ *LIBDVDCSS_VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
-major=$(shell echo "$(version)" | cut -f1 -d.)
-
 build: build-stamp
 build-stamp:
        dh_testdir
@@ -31,7 +27,7 @@ build-stamp:
        esac ;\
        ./configure $$ARCH_FLAGS --mandir=$${prefix}/share/man \
                --infodir=$${prefix}/share/info \
-               $(shell echo $(CONFIG_FLAGS)) $(shell echo $(LIBDVDCSS_FLAGS))
+               $(shell echo $(CONFIG_FLAGS)) $(shell echo $(DVDCSS_FLAGS))
 
        $(MAKE)
 
@@ -91,16 +87,6 @@ install: build
        ln -s vlc.1.gz debian/vlc-qt/usr/share/man/man1/qvlc.1.gz
        ln -s vlc.1.gz debian/vlc-kde/usr/share/man/man1/kvlc.1.gz
 
-# libdvdcss start
-       mv debian/vlc/usr/include/videolan/dvdcss.h \
-                               debian/libdvdcss$(major)-dev/usr/include/videolan
-       rm -Rf debian/vlc/usr/include
-       mv debian/vlc/usr/lib/*.a debian/libdvdcss$(major)-dev/usr/lib
-       mv debian/vlc/usr/lib/*.so debian/libdvdcss$(major)-dev/usr/lib
-       mv debian/vlc/usr/lib/*.so.* debian/libdvdcss$(major)/usr/lib
-       ln -s libdvdcss$(major) debian/libdvdcss$(major)-dev/usr/share/doc/libdvdcss$(major)-dev
-# libdvdcss stop
-
 # Build architecture-independent files here.
 binary-indep: build install
 # We have nothing to do by default.
@@ -122,9 +108,6 @@ binary-arch: build install
 #      dh_installinfo
 #      dh_undocumented
        dh_installchangelogs -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-alsa -Nvlc-sdl -Nvlc-qt -Nvlc-arts -Nvlc-mad -Nvlc-lirc -Nvlc-a52 -Nvlc-kde -Nvlc-aa ChangeLog
-# libdvdcss start
-       dh_installchangelogs -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-alsa -Nvlc-sdl -Nvlc-qt -Nvlc-arts -Nvlc-mad -Nvlc-lirc -Nvlc-a52 -Nvlc-kde -Nvlc-aa ChangeLog.libdvdcss
-# libdvdcss stop
        dh_link
        dh_strip
        dh_compress
index 87ba872d70323c63324e6b245f24d7f9262419bf..ba136a5d789b690a9ed335b4054dc4de891a7d75 100644 (file)
   - updater le numéro de version partout où c'est nécessaire
      · configure.in (relancer autoconf)
      · vlc.spec
-     · extras/libdvdcss/libdvdcss.spec (si nécessaire)
      · ipkg/control
      · debian/changelog
   - mettre à jour les ChangeLog et la TODO list pour ceux qui auraient
     étourdiment oublié de l'updater à chaque commit
   - updater le numéro de version et le timestamp dans :
      · ChangeLog
-     · ChangeLog.libdvdcss (si nécessaire)
   - updater debian/changelog (laissez faire sam si vous ne savez pas
     comment faire)
 
@@ -30,9 +28,6 @@
   - créer le tar.gz et le tar.bz2 du vlc avec `make snapshot'.
   - copier le tar.gz et le tar.bz2 sur brahma, dans le répertoire
     /opt/ftp/pub/videolan/vlc/<n° de version>/
-  - créer le tar.gz et le tar.bz2 de libdvdcss avec `make libdvdcss-snapshot'.
-  - copier le tar.gz et le tar.bz2 sur brahma, dans le répertoire
-    /opt/ftp/pub/videolan/libdvdcss/<n° de version>/
   - si les répertoires créés ne sont pas en g+w, corriger cela
 
  * Packages Debian pour videolan.org
@@ -44,7 +39,7 @@
  * Packages Debian officiels pour debian.org
 
   - normalement il n'y a que sam qui touche à ça.
-  - créer un tar.gz sans libdvdcss avec `make snapshot-nocss'
+  - créer un tar.gz sans support dvdcss avec `make snapshot-nocss'
   - `dpkg-buildpackage -rfakeroot'
   - `debupload'
 
@@ -72,7 +67,6 @@
 
   - le web se trouve dans /opt/www/videolan/htdocs/
   - éditer vlc/download.html pour mettre à jour les tarballs
-  - éditer libdvdcss/download.html si nécessaire
   - éditer news.msg pour mettre une petite bafouille sur la release, en
     s'inspirant des releases précédentes et du changelog quand on n'a pas
     d'idées
@@ -92,7 +86,6 @@
   - cliquer sur la branche de la release, par exemple Ourumov
   - choisir "add release" dans le menu déroulant
   - remplir tout le bazar, et submit
-  - refaire pareil avec http://www.freshmeat.net/projects/libdvdcss/
   - l'update peut mettre plusieurs heures
 
  * Mail d'annonce
diff --git a/extras/BSDI_dvdioctl/COPYING b/extras/BSDI_dvdioctl/COPYING
deleted file mode 100644 (file)
index d60c31a..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/extras/BSDI_dvdioctl/Makefile b/extras/BSDI_dvdioctl/Makefile
deleted file mode 100644 (file)
index 1d410ee..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-all: libdvd.a libdvd.so blkreset
-
-blkreset: libdvd.a blkreset.c
-       cc -O2 -g -o blkreset blkreset.c libdvd.a
-
-dvdioctl.o: dvdioctl.c dvd.h
-       cc -O2 -g -c -I. dvdioctl.c
-
-dvdioctl.po: dvdioctl.c dvd.h
-       cc -O2 -fPIC -DPIC -g -c -o dvdioctl.po -I. dvdioctl.c
-
-libdvd.a: dvdioctl.o
-       ar rcv libdvd.a dvdioctl.o
-
-libdvd.so: dvdioctl.po
-       cc -shared -o libdvd.so dvdioctl.po
-
-install: libdvd.a libdvd.so blkreset
-       install -c -m 644 libdvd.a /usr/local/lib/libdvd.a
-       install -c -m 755 libdvd.so /usr/local/lib/libdvd.so
-       ranlib /usr/local/lib/libdvd.a
-       install -c -m 644 dvd.h /usr/local/include/dvd.h
-       install -c -m 755 blkreset /usr/local/bin/blkreset
-
-clean:
-       rm -f *.a *.o *.so *.po blkreset
diff --git a/extras/BSDI_dvdioctl/blkreset.c b/extras/BSDI_dvdioctl/blkreset.c
deleted file mode 100644 (file)
index fc582e5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This is a (very) simple program to be used when the blocksize on a CDrom
- * drive gets set to something other than 2048 (such as 2336 when ripping
- * VCDs).   
- *
- * Uses the 'cdrom_blocksize' routine from libdvd
-*/
-
-#include <stdio.h>
-#include <err.h>
-#include <fcntl.h>
-
-main(int argc, char **argv)
-       {
-       int     fd;
-       char    *device = "/dev/rsr1c";
-
-       if      (argc != 2)
-               errx(1, "raw device name of CDROM drive needed as arg");
-       
-       device = argv[1];
-       fd = open(device, O_RDONLY, 0);
-       if      (fd < 0)
-               err(1, "open(%s)", device);
-
-       if      (cdrom_blocksize(fd, 2048))
-               errx(1, "cdrom_blocksize for %s failed\n", device);
-       exit(0);
-       }
diff --git a/extras/BSDI_dvdioctl/dvd.h b/extras/BSDI_dvdioctl/dvd.h
deleted file mode 100644 (file)
index 43b2895..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-#ifndef        _DVD_H_
-#define        _DVD_H_
-
-#include <sys/cdefs.h>
-#include <machine/endian.h>
-#include <sys/ioctl.h>
-
-__BEGIN_DECLS
-int    dvd_cdrom_ioctl(int, unsigned long, void *);
-int    cdrom_blocksize(int, int);
-void   dvd_cdrom_debug(int);
-__END_DECLS
-
-#define        ioctl(a,b,c)    dvd_cdrom_ioctl((a),(b),(c))
-
-typedef        unsigned char __u8;
-typedef        unsigned short __u16;
-typedef        unsigned int __u32;
-
-#define DVD_READ_STRUCT                0x5390  /* Read structure */
-#define DVD_WRITE_STRUCT       0x5391  /* Write structure */
-#define DVD_AUTH               0x5392  /* Authentication */
-
-#define DVD_STRUCT_PHYSICAL    0x00
-#define DVD_STRUCT_COPYRIGHT   0x01
-#define DVD_STRUCT_DISCKEY     0x02
-#define DVD_STRUCT_BCA         0x03
-#define DVD_STRUCT_MANUFACT    0x04
-
-struct dvd_layer {
-       __u8 book_version       : 4;
-       __u8 book_type          : 4;
-       __u8 min_rate           : 4;
-       __u8 disc_size          : 4;
-       __u8 layer_type         : 4;
-       __u8 track_path         : 1;
-       __u8 nlayers            : 2;
-       __u8 track_density      : 4;
-       __u8 linear_density     : 4;
-       __u8 bca                : 1;
-       __u32 start_sector;
-       __u32 end_sector;
-       __u32 end_sector_l0;
-};
-
-struct dvd_physical {
-       __u8 type;
-       __u8 layer_num;
-       struct dvd_layer layer[4];
-};
-
-struct dvd_copyright {
-       __u8 type;
-
-       __u8 layer_num;
-       __u8 cpst;
-       __u8 rmi;
-};
-
-struct dvd_disckey {
-       __u8 type;
-
-       unsigned agid           : 2;
-       __u8 value[2048];
-};
-
-struct dvd_bca {
-       __u8 type;
-
-       int len;
-       __u8 value[188];
-};
-
-struct dvd_manufact {
-       __u8 type;
-
-       __u8 layer_num;
-       int len;
-       __u8 value[2048];
-};
-
-typedef union {
-       __u8 type;
-
-       struct dvd_physical     physical;
-       struct dvd_copyright    copyright;
-       struct dvd_disckey      disckey;
-       struct dvd_bca          bca;
-       struct dvd_manufact     manufact;
-} dvd_struct;
-
-/*
- * DVD authentication ioctl
- */
-
-/* Authentication states */
-#define DVD_LU_SEND_AGID       0
-#define DVD_HOST_SEND_CHALLENGE        1
-#define DVD_LU_SEND_KEY1       2
-#define DVD_LU_SEND_CHALLENGE  3
-#define DVD_HOST_SEND_KEY2     4
-
-/* Termination states */
-#define DVD_AUTH_ESTABLISHED   5
-#define DVD_AUTH_FAILURE       6
-
-/* Other functions */
-#define DVD_LU_SEND_TITLE_KEY  7
-#define DVD_LU_SEND_ASF                8
-#define DVD_INVALIDATE_AGID    9
-#define DVD_LU_SEND_RPC_STATE  10
-#define DVD_HOST_SEND_RPC_STATE        11
-
-/* State data */
-typedef __u8 dvd_key[5];               /* 40-bit value, MSB is first elem. */
-typedef __u8 dvd_challenge[10];        /* 80-bit value, MSB is first elem. */
-
-struct dvd_lu_send_agid {
-       __u8 type;
-       unsigned agid           : 2;
-};
-
-struct dvd_host_send_challenge {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_challenge chal;
-};
-
-struct dvd_send_key {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_key key;
-};
-
-struct dvd_lu_send_challenge {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_challenge chal;
-};
-
-#define DVD_CPM_NO_COPYRIGHT   0
-#define DVD_CPM_COPYRIGHTED    1
-
-#define DVD_CP_SEC_NONE                0
-#define DVD_CP_SEC_EXIST       1
-
-#define DVD_CGMS_UNRESTRICTED  0
-#define DVD_CGMS_SINGLE                2
-#define DVD_CGMS_RESTRICTED    3
-
-struct dvd_lu_send_title_key {
-       __u8 type;
-       unsigned agid           : 2;
-
-       dvd_key title_key;
-       int lba;
-       unsigned cpm            : 1;
-       unsigned cp_sec         : 1;
-       unsigned cgms           : 2;
-};
-
-struct dvd_lu_send_asf {
-       __u8 type;
-       unsigned agid           : 2;
-
-       unsigned asf            : 1;
-};
-
-struct dvd_host_send_rpcstate {
-       __u8 type;
-       __u8 pdrc;
-};
-
-struct dvd_lu_send_rpcstate {
-       __u8 type               : 2;
-       __u8 vra                : 3;
-       __u8 ucca               : 3;
-       __u8 region_mask;
-       __u8 rpc_scheme;
-};
-
-typedef union {
-       __u8 type;
-
-       struct dvd_lu_send_agid         lsa;
-       struct dvd_host_send_challenge  hsc;
-       struct dvd_send_key             lsk;
-       struct dvd_lu_send_challenge    lsc;
-       struct dvd_send_key             hsk;
-       struct dvd_lu_send_title_key    lstk;
-       struct dvd_lu_send_asf          lsasf;
-       struct dvd_host_send_rpcstate   hrpcs;
-       struct dvd_lu_send_rpcstate     lrpcs;
-} dvd_authinfo;
-
-
-typedef struct {
-       __u16 report_key_length;
-       __u8 reserved1;
-       __u8 reserved2;
-#if BYTE_ORDER == BIG_ENDIAN
-       __u8 type_code                  : 2;
-       __u8 vra                        : 3;
-       __u8 ucca                       : 3;
-#elif BYTE_ORDER == LITTLE_ENDIAN
-       __u8 ucca                       : 3;
-       __u8 vra                        : 3;
-       __u8 type_code                  : 2;
-#endif
-       __u8 region_mask;
-       __u8 rpc_scheme;
-       __u8 reserved3;
-} rpc_state_t;
-
-/*
- * Stuff for the CDROM ioctls
-*/
-
-#define CDROMREADTOCHDR                0x5305 /* Read TOC header (cdrom_tochdr) */
-#define CDROMREADTOCENTRY      0x5306 /* Read TOC entry (cdrom_tocentry) */
-#define CDROMEJECT             0x5309 /* Ejects the cdrom media */
-#define CDROMCLOSETRAY          0x5319 /* Reverse of CDROMEJECT */
-#define CDROM_DRIVE_STATUS      0x5326 /* Get tray position, etc. */
-#define CDROMREADMODE2         0x530c /* Read CDROM mode 2 data (2336 Bytes) */
-#define CDROMREADMODE1         0x530d /* Read CDROM mode 1 data (2048 Bytes) */
-#define CDROMREADRAW            0x5314 /* read data in raw mode (2352 bytes) */
-
-#define CD_MINS              74 /* max. minutes per CD, not really a limit */
-#define CD_SECS              60 /* seconds per minute */
-#define CD_FRAMES            75 /* frames per second */
-#define CD_MSF_OFFSET       150 /* MSF numbering offset of first frame */
-
-#define CD_HEAD_SIZE          4 /* header (address) bytes per raw data frame */
-#define CD_SYNC_SIZE         12 /* 12 sync bytes per raw data frame */
-#define CD_FRAMESIZE       2048 /* bytes per frame, "cooked" mode */
-#define CD_FRAMESIZE_RAW   2352 /* bytes per frame, "raw" mode */
-#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/
-#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE)      /*2340*/
-
-/* CD-ROM address types (cdrom_tocentry.cdte_format) */
-#define CDROM_LBA 0x01                 /* logical block: first frame is #0 */
-#define CDROM_MSF 0x02                 /* minute-second-frame: binary. not bcd here!*/
-
-/* The leadout track is always 0xAA, regardless of # of tracks on disc */
-#define CDROM_LEADOUT           0xAA
-
-/* drive status returned by CDROM_DRIVE_STATUS ioctl */
-#define CDS_NO_INFO             0       /* if not implemented */
-#define CDS_NO_DISC             1
-#define CDS_TRAY_OPEN           2
-#define CDS_DRIVE_NOT_READY     3
-#define CDS_DISC_OK             4
-
-/* For compile compatibility only - we don't support changers */
-#define CDSL_NONE               ((int) (~0U>>1)-1)
-#define CDSL_CURRENT            ((int) (~0U>>1))
-
-struct cdrom_msf 
-{
-       __u8    cdmsf_min0;     /* start minute */
-       __u8    cdmsf_sec0;     /* start second */
-       __u8    cdmsf_frame0;   /* start frame */
-       __u8    cdmsf_min1;     /* end minute */
-       __u8    cdmsf_sec1;     /* end second */
-       __u8    cdmsf_frame1;   /* end frame */
-};
-
-struct cdrom_tochdr    
-       {
-       __u8    cdth_trk0;      /* start track */
-       __u8    cdth_trk1;      /* end track */
-       };
-
-struct cdrom_msf0              
-{
-       __u8    minute;
-       __u8    second;
-       __u8    frame;
-};
-
-union cdrom_addr               
-{
-       struct cdrom_msf0       msf;
-       int                     lba;
-};
-
-struct cdrom_tocentry 
-{
-       __u8    cdte_track;
-       __u8    cdte_adr        :4;
-       __u8    cdte_ctrl       :4;
-       __u8    cdte_format;
-       union cdrom_addr cdte_addr;
-       __u8    cdte_datamode;
-};
-
-struct modesel_head
-{
-       __u8    reserved1;
-       __u8    medium;
-       __u8    reserved2;
-       __u8    block_desc_length;
-       __u8    density;
-       __u8    number_of_blocks_hi;
-       __u8    number_of_blocks_med;
-       __u8    number_of_blocks_lo;
-       __u8    reserved3;
-       __u8    block_length_hi;
-       __u8    block_length_med;
-       __u8    block_length_lo;
-};
-#endif /* _DVD_H_ */
diff --git a/extras/BSDI_dvdioctl/dvdioctl.c b/extras/BSDI_dvdioctl/dvdioctl.c
deleted file mode 100644 (file)
index 7b8601a..0000000
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * Hacked version of the linux cdrom.c kernel module - everything except the
- * DVD handling ripped out and the rest rewritten to use raw SCSI commands
- * on BSD/OS 4.2 (but should work with earlier versions as well).
-*/
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include </sys/dev/scsi/scsi.h>
-#include </sys/dev/scsi/scsi_ioctl.h>
-#include "dvd.h"
-
-/*
- * Now get rid of the override/intercept macro so we can call the real ioctl()
- * routine!
-*/
-#undef ioctl
-
-#define CMD_READ_10             0x28
-#define CMD_READ_TOC_PMA_ATIP   0x43
-#define CMD_READ_CD             0xbe
-#define        CMD_START_STOP_UNIT     0x1b
-
-#define        CMD_SEND_KEY            0xa3
-#define        CMD_REPORT_KEY          0xa4
-#define        CMD_READ_DVD_STRUCTURE  0xad
-
-#define copy_key(dest,src)     memcpy((dest), (src), sizeof(dvd_key))
-#define copy_chal(dest,src)    memcpy((dest), (src), sizeof(dvd_challenge))
-
-/* Define the Cdrom Generic Command structure */
-typedef        struct  cgc
-               {
-               u_char  cdb[12];
-               u_char  *buf;
-               int     buflen;
-               int     rw;
-               int     timeout;
-               struct scsi_user_cdb    *sus;
-               } cgc_t;
-
-static int scsi_cmd(int, cgc_t *);
-static int cdrom_ioctl(int, u_long, void *);
-static int cdrom_tray_move(int, int);
-static int dvd_ioctl(int, u_long, void *);
-static int     debug;
-
-void dvd_cdrom_debug(int flag)
-       {
-       debug = flag;
-       }
-
-/*
- * This is the published entry point.   Actually applications should simply
- * include <dvd.h> and not refer to this at all.
-*/
-int dvd_cdrom_ioctl(int fd, unsigned long cmd, void *arg)
-       {
-       switch  (cmd)
-               {
-               case    DVD_AUTH:
-               case    DVD_READ_STRUCT:
-                       return(dvd_ioctl(fd, cmd, arg));
-               case    CDROMREADTOCHDR:
-               case    CDROMREADTOCENTRY:
-               case    CDROMEJECT:
-               case    CDROMREADRAW:
-               case    CDROMREADMODE2:
-               case    CDROMCLOSETRAY:
-               case    CDROM_DRIVE_STATUS:
-                       return(cdrom_ioctl(fd, cmd, arg));
-               default:
-                       return(ioctl(fd, cmd, arg));
-               }
-       }
-
-static void setup_report_key(cgc_t *cgc, u_int agid, u_int type)
-       {
-
-       cgc->cdb[0] = CMD_REPORT_KEY;
-       cgc->cdb[10] = type | (agid << 6);
-       switch  (type)
-               {
-               case    0:
-               case    5:
-               case    8:
-                       cgc->buflen = 8;
-                       break;
-               case    1:
-                       cgc->buflen = 16;
-                       break;
-               case    2:
-               case    4:
-                       cgc->buflen = 12;
-                       break;
-               }
-       cgc->cdb[9] = cgc->buflen;
-       cgc->rw = SUC_READ;;
-       }
-
-static void setup_send_key(cgc_t *cgc, u_int agid, u_int type)
-       {
-
-       cgc->cdb[0] = CMD_SEND_KEY;
-       cgc->cdb[10] = type | (agid << 6);
-       switch  (type)
-               {
-               case    1:
-                       cgc->buflen = 16;
-                       break;
-               case    3:
-                       cgc->buflen = 12;
-                       break;
-               case    6:
-                       cgc->buflen = 8;
-                       break;
-               }
-       cgc->cdb[9] = cgc->buflen;
-       cgc->rw = SUC_WRITE;
-       }
-
-static void cgc_init(cgc_t *cgc, void *buf, int len, int type)
-       {
-
-       memset(cgc, 0, sizeof (*cgc));
-       if      (buf)
-               memset(buf, 0, len);
-       cgc->buf = (u_char *)buf;
-       cgc->buflen = len;
-       cgc->rw = type;
-       cgc->timeout = 5;       /* 5 second timeout */
-       }
-
-static int dvd_do_auth(int fd, dvd_authinfo *ai)
-       {
-       int     ret;
-       u_char  buf[20];
-       cgc_t   cgc;
-       rpc_state_t rpc_state;
-
-       memset(buf, 0, sizeof(buf));
-       cgc_init(&cgc, buf, 0, SUC_READ);
-
-       switch  (ai->type)
-               {
-               case    DVD_LU_SEND_AGID:       /* LU data send */
-                       setup_report_key(&cgc, ai->lsa.agid, 0);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       ai->lsa.agid = buf[7] >> 6;
-                       break;
-               case    DVD_LU_SEND_KEY1:
-                       setup_report_key(&cgc, ai->lsk.agid, 2);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       copy_key(ai->lsk.key, &buf[4]);
-                       break;
-               case    DVD_LU_SEND_CHALLENGE:
-                       setup_report_key(&cgc, ai->lsc.agid, 1);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       copy_chal(ai->lsc.chal, &buf[4]);
-                       break;
-               case    DVD_LU_SEND_TITLE_KEY:  /* Post-auth key */
-                       setup_report_key(&cgc, ai->lstk.agid, 4);
-                       cgc.cdb[5] = ai->lstk.lba;
-                       cgc.cdb[4] = ai->lstk.lba >> 8;
-                       cgc.cdb[3] = ai->lstk.lba >> 16;
-                       cgc.cdb[2] = ai->lstk.lba >> 24;
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       ai->lstk.cpm = (buf[4] >> 7) & 1;
-                       ai->lstk.cp_sec = (buf[4] >> 6) & 1;
-                       ai->lstk.cgms = (buf[4] >> 4) & 3;
-                       copy_key(ai->lstk.title_key, &buf[5]);
-                       break;
-               case    DVD_LU_SEND_ASF:
-                       setup_report_key(&cgc, ai->lsasf.agid, 5);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       ai->lsasf.asf = buf[7] & 1;
-                       break;
-               case    DVD_HOST_SEND_CHALLENGE: /* LU data receive (LU changes state) */
-                       setup_send_key(&cgc, ai->hsc.agid, 1);
-                       buf[1] = 0xe;
-                       copy_chal(&buf[4], ai->hsc.chal);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       ai->type = DVD_LU_SEND_KEY1;
-                       break;
-               case    DVD_HOST_SEND_KEY2:
-                       setup_send_key(&cgc, ai->hsk.agid, 3);
-                       buf[1] = 0xa;
-                       copy_key(&buf[4], ai->hsk.key);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               {
-                               ai->type = DVD_AUTH_FAILURE;
-                               return ret;
-                               }
-                       ai->type = DVD_AUTH_ESTABLISHED;
-                       break;
-               case    DVD_INVALIDATE_AGID:
-                       setup_report_key(&cgc, ai->lsa.agid, 0x3f);
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       break;
-               case    DVD_LU_SEND_RPC_STATE:  /* Get region settings */
-                       setup_report_key(&cgc, 0, 8);
-                       memset(&rpc_state, 0, sizeof(rpc_state_t));
-                       cgc.buf = (char *) &rpc_state;
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               {
-                               ai->lrpcs.type = 0;
-                               ai->lrpcs.rpc_scheme = 0;
-                               }
-                       else
-                               {
-                               ai->lrpcs.type = rpc_state.type_code;
-                               ai->lrpcs.vra = rpc_state.vra;
-                               ai->lrpcs.ucca = rpc_state.ucca;
-                               ai->lrpcs.region_mask = rpc_state.region_mask;
-                               ai->lrpcs.rpc_scheme = rpc_state.rpc_scheme;
-                               }
-                       break;
-               case    DVD_HOST_SEND_RPC_STATE:  /* Set region settings */
-                       setup_send_key(&cgc, 0, 6);
-                       buf[1] = 6;
-                       buf[4] = ai->hrpcs.pdrc;
-                       if      (ret = scsi_cmd(fd, &cgc))
-                               return ret;
-                       break;
-               default:
-                       return EINVAL;
-               }
-       return 0;
-       }
-
-static int dvd_read_physical(int fd, dvd_struct *s)
-       {
-       int ret, i;
-       u_char buf[4 + 4 * 20], *base;
-       struct dvd_layer *layer;
-       cgc_t cgc;
-
-       cgc_init(&cgc, buf, sizeof(buf), SUC_READ);
-       cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
-       cgc.cdb[6] = s->physical.layer_num;
-       cgc.cdb[7] = s->type;
-       cgc.cdb[9] = cgc.buflen & 0xff;
-
-       if      (ret = scsi_cmd(fd, &cgc))
-               return ret;
-
-       base = &buf[4];
-       layer = &s->physical.layer[0];
-
-       /* place the data... really ugly, but at least we won't have to
-          worry about endianess in userspace or here. */
-       for     (i = 0; i < 4; ++i, base += 20, ++layer)
-               {
-               memset(layer, 0, sizeof(*layer));
-               layer->book_version = base[0] & 0xf;
-               layer->book_type = base[0] >> 4;
-               layer->min_rate = base[1] & 0xf;
-               layer->disc_size = base[1] >> 4;
-               layer->layer_type = base[2] & 0xf;
-               layer->track_path = (base[2] >> 4) & 1;
-               layer->nlayers = (base[2] >> 5) & 3;
-               layer->track_density = base[3] & 0xf;
-               layer->linear_density = base[3] >> 4;
-               layer->start_sector = base[5] << 16 | base[6] << 8 | base[7];
-               layer->end_sector = base[9] << 16 | base[10] << 8 | base[11];
-               layer->end_sector_l0 = base[13] << 16 | base[14] << 8 | base[15];
-               layer->bca = base[16] >> 7;
-               }
-       return 0;
-       }
-
-static int dvd_read_copyright(int fd, dvd_struct *s)
-       {
-       int ret;
-       u_char buf[8];
-       cgc_t cgc;
-
-       cgc_init(&cgc, buf, sizeof(buf), SUC_READ);
-       cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
-       cgc.cdb[6] = s->copyright.layer_num;
-       cgc.cdb[7] = s->type;
-       cgc.cdb[8] = cgc.buflen >> 8;
-       cgc.cdb[9] = cgc.buflen & 0xff;
-
-       if      (ret = scsi_cmd(fd, &cgc))
-               return ret;
-       s->copyright.cpst = buf[4];
-       s->copyright.rmi = buf[5];
-       return 0;
-       }
-
-static int dvd_read_disckey(int fd, dvd_struct *s)
-       {
-       int ret, size;
-       u_char *buf;
-       cgc_t cgc;
-
-       size = sizeof(s->disckey.value) + 4;
-
-       if      ((buf = (u_char *) malloc(size)) == NULL)
-               return ENOMEM;
-
-       cgc_init(&cgc, buf, size, SUC_READ);
-       cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
-       cgc.cdb[7] = s->type;
-       cgc.cdb[8] = size >> 8;
-       cgc.cdb[9] = size & 0xff;
-       cgc.cdb[10] = s->disckey.agid << 6;
-
-       if      (!(ret = scsi_cmd(fd, &cgc)))
-               memcpy(s->disckey.value, &buf[4], sizeof(s->disckey.value));
-       free(buf);
-       return ret;
-       }
-
-static int dvd_read_bca(int fd, dvd_struct *s)
-       {
-       int ret;
-       u_char buf[4 + 188];
-       cgc_t cgc;
-
-       cgc_init(&cgc, buf, sizeof(buf), SUC_READ);
-       cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
-       cgc.cdb[7] = s->type;
-       cgc.cdb[9] = cgc.buflen = 0xff;
-
-       if      (ret = scsi_cmd(fd, &cgc))
-               return ret;
-       s->bca.len = buf[0] << 8 | buf[1];
-       if      (s->bca.len < 12 || s->bca.len > 188)
-               return EIO;
-       memcpy(s->bca.value, &buf[4], s->bca.len);
-       return 0;
-       }
-
-static int dvd_read_manufact(int fd, dvd_struct *s)
-       {
-       int ret = 0, size;
-       u_char *buf;
-       cgc_t cgc;
-
-       size = sizeof(s->manufact.value) + 4;
-
-       if      ((buf = (u_char *) malloc(size)) == NULL)
-               return ENOMEM;
-
-       cgc_init(&cgc, buf, size, SUC_READ);
-       cgc.cdb[0] = CMD_READ_DVD_STRUCTURE;
-       cgc.cdb[7] = s->type;
-       cgc.cdb[8] = size >> 8;
-       cgc.cdb[9] = size & 0xff;
-
-       if      (ret = scsi_cmd(fd, &cgc))
-               {
-               free(buf);
-               return ret;
-               }
-       s->manufact.len = buf[0] << 8 | buf[1];
-       if      (s->manufact.len < 0 || s->manufact.len > 2048)
-               ret = -EIO;
-       else
-               memcpy(s->manufact.value, &buf[4], s->manufact.len);
-       free(buf);
-       return ret;
-       }
-
-static int dvd_read_struct(int fd, dvd_struct *s)
-       {
-       switch  (s->type)
-               {
-               case    DVD_STRUCT_PHYSICAL:
-                       return dvd_read_physical(fd, s);
-               case    DVD_STRUCT_COPYRIGHT:
-                       return dvd_read_copyright(fd, s);
-               case    DVD_STRUCT_DISCKEY:
-                       return dvd_read_disckey(fd, s);
-               case    DVD_STRUCT_BCA:
-                       return dvd_read_bca(fd, s);
-               case    DVD_STRUCT_MANUFACT:
-                       return dvd_read_manufact(fd, s);
-               default:
-                       return EINVAL;
-               }
-       }
-
-static u_char scsi_cdblen[8] = {6, 10, 10, 12, 12, 12, 10, 10};
-
-static int scsi_cmd(int fd, cgc_t *cgc)
-       {
-       int     scsistatus, cdblen;
-       unsigned char   *cp;
-       struct  scsi_user_cdb suc;
-
-    /* safety checks */
-       if      (cgc->rw != SUC_READ && cgc->rw != SUC_WRITE)
-               return(EINVAL);
-
-       suc.suc_flags = cgc->rw;
-       cdblen = scsi_cdblen[(cgc->cdb[0] >> 5) & 7];
-       suc.suc_cdblen = cdblen;
-       bcopy(cgc->cdb, suc.suc_cdb, cdblen);
-       suc.suc_data = cgc->buf;
-       suc.suc_datalen = cgc->buflen;
-       suc.suc_timeout = cgc->timeout;
-       if      (ioctl(fd, SCSIRAWCDB, &suc) == -1)
-               return(errno);
-       scsistatus = suc.suc_sus.sus_status;
-
-/*
- * If the device returns a scsi sense error and debugging is enabled print
- * some hopefully useful information on stderr.
-*/
-       if      (scsistatus && debug)
-               {
-               cp = suc.suc_sus.sus_sense;
-               fprintf(stderr,"scsistatus = %x cmd = %x\n",
-                       scsistatus, cgc->cdb[0]);
-               fprintf(stderr, "sense %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n", 
-                       cp[0], cp[1], cp[2], cp[3], cp[4], cp[5],
-                       cp[6], cp[7], cp[8], cp[9], cp[10], cp[11],
-                       cp[12], cp[13], cp[14], cp[15]);
-               }
-       if      (cgc->sus)
-               bcopy(&suc, cgc->sus, sizeof (struct scsi_user_cdb));
-       if      (scsistatus)
-               return(EIO);    /* generic i/o error for unsuccessful status */
-       return(0);
-       }
-
-/*
- * The entry point for the DVDioctls for BSD/OS.
-*/
-static int dvd_ioctl(int fd, u_long cmd, void *arg)
-       {
-       int     ret;
-
-       switch  (cmd)
-               {
-               case    DVD_READ_STRUCT:
-                       ret = dvd_read_struct(fd, (dvd_struct *)arg);
-                       if      (ret)
-                               errno = ret;
-                       return(ret ? -1 : 0);
-               case    DVD_AUTH:
-                       ret = dvd_do_auth (fd, (dvd_authinfo *)arg);
-                       if      (ret)
-                               errno = ret;
-                       return(ret ? -1 : 0);
-               default:
-                       errno = EINVAL;
-                       return(-1);
-               }
-       }
-
-/*
- * The entry point for the CDROMioctls for BSD/OS
-*/
-static int cdrom_read_block(int, cgc_t *, int, int, int, int);
-static int cdrom_read_cd(int, cgc_t *, int, int, int );
-       int cdrom_blocksize(int, int );
-
-static inline
-int msf_to_lba(char m, char s, char f)
-{
-       return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
-}
-
-cdrom_ioctl(int fd, u_long cmd, void *arg)
-       {
-       int     ret;
-       cgc_t   cgc;
-
-       switch  (cmd)
-               {
-               case    CDROMREADRAW:
-               case    CDROMREADMODE1:
-               case    CDROMREADMODE2:
-                       {
-                       struct cdrom_msf *msf;
-                       int blocksize = 0, format = 0, lba;
-               
-                       switch  (cmd)
-                               {
-                               case    CDROMREADRAW:
-                                       blocksize = CD_FRAMESIZE_RAW;
-                                       break;
-                               case    CDROMREADMODE1:
-                                       blocksize = CD_FRAMESIZE;
-                                       format = 2;
-                                       break;
-                               case    CDROMREADMODE2:
-                                       blocksize = CD_FRAMESIZE_RAW0;
-                                       break;
-                               }
-                       msf = (struct cdrom_msf *)arg;
-                       lba = msf_to_lba(msf->cdmsf_min0,msf->cdmsf_sec0,
-                               msf->cdmsf_frame0);
-                       ret = EINVAL;
-                       if      (lba < 0)
-                               break;
-
-                       cgc_init(&cgc, arg, blocksize, SUC_READ);
-                       ret = cdrom_read_block(fd, &cgc, lba, 1, format,                                                        blocksize);
-                       if      (ret)
-                               {
-/*
- * SCSI-II devices are not required to support CMD_READ_CD (which specifies
- * the blocksize to read) so try switching the block size with a mode select,
- * doing the normal read sector command and then changing the sector size back
- * to 2048.
- *
- * If the program dies before changing the blocksize back sdopen()
- * in the kernel will fail opens with a message that looks something like:
- *
- * "sr1: blksize 2336 not multiple of 512: cannot use"
- *
- * At that point the drive has to be power cycled (or reset in some other way).
-*/
-                               if      (ret = cdrom_blocksize(fd, blocksize))
-                                       break;
-                               ret = cdrom_read_cd(fd, &cgc, lba, blocksize, 1);
-                               ret |= cdrom_blocksize(fd, 2048);
-                               }
-                       break;
-                       }
-               case    CDROMREADTOCHDR:
-                       {
-                       struct cdrom_tochdr *tochdr = (struct cdrom_tochdr *) arg;
-                       u_char buffer[12];
-                       
-                       cgc_init(&cgc, buffer, sizeof (buffer), SUC_READ);
-                       cgc.cdb[0] = CMD_READ_TOC_PMA_ATIP;
-                       cgc.cdb[1] = 0x2;       /* MSF */
-                       cgc.cdb[8] = 12;        /* LSB of length */
-
-                       ret = scsi_cmd(fd, &cgc);
-                       if      (!ret)
-                               {
-                               tochdr->cdth_trk0 = buffer[2];
-                               tochdr->cdth_trk1 = buffer[3];
-                               }
-                       break;
-                       }
-               case    CDROMREADTOCENTRY:
-                       {
-                       struct cdrom_tocentry *tocentry = (struct cdrom_tocentry *) arg;
-                       u_char  buffer[12];
-
-                       cgc_init(&cgc, buffer, sizeof (buffer), SUC_READ);
-                       cgc.cdb[0] = CMD_READ_TOC_PMA_ATIP;
-                       cgc.cdb[1] = (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;
-                       cgc.cdb[6] = tocentry->cdte_track;
-                       cgc.cdb[8] = 12;                /* LSB of length */
-
-                       ret = scsi_cmd(fd, &cgc);
-                       if      (ret)
-                               break;
-
-                       tocentry->cdte_ctrl = buffer[5] & 0xf;
-                       tocentry->cdte_adr = buffer[5] >> 4;
-                       tocentry->cdte_datamode = (tocentry->cdte_ctrl & 0x04) ? 1 : 0;
-                       if      (tocentry->cdte_format == CDROM_MSF)
-                               {
-                               tocentry->cdte_addr.msf.minute = buffer[9];
-                               tocentry->cdte_addr.msf.second = buffer[10];
-                               tocentry->cdte_addr.msf.frame = buffer[11];
-                               }
-                       else
-                               tocentry->cdte_addr.lba = (((((buffer[8] << 8) 
-                                               + buffer[9]) << 8)
-                                               + buffer[10]) << 8) 
-                                               + buffer[11];
-                       break;
-                       }
-               case    CDROMEJECT:             /* NO-OP for now */
-                       ret = cdrom_tray_move(fd, 1);
-                       break;
-               case    CDROMCLOSETRAY:
-                       ret = cdrom_tray_move(fd, 0);
-                       break;
-/*
- * This sucks but emulates the expected behaviour.  Instead of the return 
- * value being the actual status a success/fail indicator should have been
- * returned and the 3rd arg to the ioctl should have been an 'int *' to update
- * with the actual status.
-*/
-               case    CDROM_DRIVE_STATUS:
-                       return(CDS_NO_INFO);
-                       break;
-               }
-       errno = ret;
-       return(ret ? -1 : 0);
-       }
-
-static int cdrom_read_cd(int fd, cgc_t *cgc, int lba, int blocksize, int nblocks)
-       {
-
-       memset(&cgc->cdb, 0, sizeof(cgc->cdb));
-       cgc->cdb[0] = CMD_READ_10;
-       cgc->cdb[2] = (lba >> 24) & 0xff;
-       cgc->cdb[3] = (lba >> 16) & 0xff;
-       cgc->cdb[4] = (lba >>  8) & 0xff;
-       cgc->cdb[5] = lba & 0xff;
-       cgc->cdb[6] = (nblocks >> 16) & 0xff;
-       cgc->cdb[7] = (nblocks >>  8) & 0xff;
-       cgc->cdb[8] = nblocks & 0xff;
-       cgc->buflen = blocksize * nblocks;
-       return(scsi_cmd(fd, cgc));
-       }
-
-static int cdrom_read_block(int fd, cgc_t *cgc,
-                           int lba, int nblocks, int format, int blksize)
-       {
-
-       memset(&cgc->cdb, 0, sizeof(cgc->cdb));
-       cgc->cdb[0] = CMD_READ_CD;
-       /* expected sector size - cdda,mode1,etc. */
-       cgc->cdb[1] = format << 2;
-       /* starting address */
-       cgc->cdb[2] = (lba >> 24) & 0xff;
-       cgc->cdb[3] = (lba >> 16) & 0xff;
-       cgc->cdb[4] = (lba >>  8) & 0xff;
-       cgc->cdb[5] = lba & 0xff;
-       /* number of blocks */
-       cgc->cdb[6] = (nblocks >> 16) & 0xff;
-       cgc->cdb[7] = (nblocks >>  8) & 0xff;
-       cgc->cdb[8] = nblocks & 0xff;
-       cgc->buflen = blksize * nblocks;
-       
-       /* set the header info returned */
-       switch  (blksize)
-               {
-               case    CD_FRAMESIZE_RAW0:
-                       cgc->cdb[9] = 0x58;
-                       break;
-               case    CD_FRAMESIZE_RAW1:
-                       cgc->cdb[9] = 0x78;
-                       break;
-               case    CD_FRAMESIZE_RAW:
-                       cgc->cdb[9] = 0xf8;
-                       break;
-               default:
-                       cgc->cdb[9] = 0x10;
-               }
-       return(scsi_cmd(fd, cgc));
-       }
-
-static int cdrom_tray_move(int fd, int flag)
-       {
-       cgc_t   cgc;
-
-       cgc_init(&cgc, NULL, 0, SUC_READ);
-       cgc.cdb[0] = CMD_START_STOP_UNIT;
-       cgc.cdb[1] = 1;                 /* immediate */
-       cgc.cdb[4] = flag ? 0x2 : 0x3;  /* eject : close */
-       return(scsi_cmd(fd, &cgc));
-       }
-
-/*
- * Required when we need to use READ_10 to issue other than 2048 block
- * reads
- */
-int cdrom_blocksize(int fd, int size)
-       {
-       cgc_t   cgc;
-       struct modesel_head mh;
-
-       memset(&mh, 0, sizeof(mh));
-       mh.block_desc_length = 0x08;
-       mh.block_length_med = (size >> 8) & 0xff;
-       mh.block_length_lo = size & 0xff;
-
-       memset(&cgc, 0, sizeof(cgc));
-       cgc.cdb[0] = 0x15;
-       cgc.cdb[1] = 1 << 4;
-       cgc.cdb[4] = 12;
-       cgc.buflen = sizeof(mh);
-       cgc.buf = (u_char *) &mh;
-       cgc.rw = SUC_WRITE;
-       mh.block_desc_length = 0x08;
-       mh.block_length_med = (size >> 8) & 0xff;
-       mh.block_length_lo = size & 0xff;
-       return(scsi_cmd(fd, &cgc));
-       }
diff --git a/extras/libdvdcss/.cvsignore b/extras/libdvdcss/.cvsignore
deleted file mode 100644 (file)
index 63e7180..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.dep
diff --git a/extras/libdvdcss/Makefile b/extras/libdvdcss/Makefile
deleted file mode 100644 (file)
index f7de634..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-###############################################################################
-# vlc (VideoLAN Client) dvd module Makefile
-# (c)2001 VideoLAN
-###############################################################################
-
-BASE_A := libdvdcss.a
-BASE_SO := libdvdcss.so
-MAJOR_SO := libdvdcss.so.$(shell echo $(LIBDVDCSS_VERSION) | cut -f1 -d.)
-FULL_SO := libdvdcss.so.$(LIBDVDCSS_VERSION)
-ifneq (,$(SOFLAGS))
-ALL_SOFLAGS := $(SOFLAGS)$(MAJOR_SO)
-SOFLAGS :=
-endif
-
-#
-# C headers directories
-#
-CFLAGS := -I../../include -I../../extras $(CFLAGS)
-
-#
-# Objects
-#
-OBJ_C = libdvdcss.o css.o ioctl.o
-ALL_OBJ = $(OBJ_C) $(OBJ_LIBDVDCSS)
-
-# 
-# Standard dependencies
-#
-C_DEP := $(ALL_OBJ:%.o=.dep/%.d)
-
-#
-# Virtual targets
-#
-all: ../../lib/$(FULL_SO) ../../lib/$(BASE_A)
-
-clean:
-       rm -f $(ALL_OBJ)
-       rm -f *.o
-       rm -rf .dep
-
-install:
-       mkdir -p $(DESTDIR)$(includedir)/videolan
-       $(INSTALL) -m 644 videolan/dvdcss.h $(DESTDIR)$(includedir)/videolan
-       mkdir -p $(DESTDIR)$(libdir)
-       -$(INSTALL) -m 644 ../../lib/$(BASE_A) $(DESTDIR)$(libdir)
-       -$(INSTALL) -m 644 ../../lib/$(FULL_SO) $(DESTDIR)$(libdir)
-       rm -f $(DESTDIR)$(libdir)/$(BASE_SO) && ln -s $(FULL_SO) $(DESTDIR)$(libdir)/$(BASE_SO)
-       rm -f $(DESTDIR)$(libdir)/$(MAJOR_SO) && ln -s $(FULL_SO) $(DESTDIR)$(libdir)/$(MAJOR_SO)
-
-uninstall:
-       rm -f $(DESTDIR)$(includedir)/videolan/dvdcss.h
-       rm -f $(DESTDIR)$(libdir)/$(BASE_A)
-       rm -f $(DESTDIR)$(libdir)/$(BASE_SO)
-       rm -f $(DESTDIR)$(libdir)/$(MAJOR_SO)
-       rm -f $(DESTDIR)$(libdir)/$(FULL_SO)
-
-FORCE:
-
-$(ALL_OBJ): %.o: ../../Makefile.dep Makefile
-
-$(C_DEP): %.d: FORCE
-       @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@
-
-$(OBJ_C): %.o: .dep/%.d
-$(OBJ_C): %.o: %.c
-       $(CC) $(CFLAGS) $(CFLAGS_LIBDVDCSS) $(PCFLAGS) -c -o $@ $<
-
-bsdi_dvdioctl.o: ../BSDI_dvdioctl/dvdioctl.c
-       $(CC) $(CFLAGS) $(CFLAGS_LIBDVDCSS) $(PCFLAGS) -c -o $@ $<
-
-../../lib/$(FULL_SO): $(OBJ_C) $(OBJ_LIBDVDCSS)
-       $(CC) $(PCFLAGS) $(ALL_SOFLAGS) -o $@ $^ $(PLDFLAGS) $(LIB_LIBDVDCSS)
-       rm -f ../../lib/$(BASE_SO) && ln -s $(FULL_SO) ../../lib/$(BASE_SO)
-       rm -f ../../lib/$(MAJOR_SO) && ln -s $(FULL_SO) ../../lib/$(MAJOR_SO)
-
-../../lib/$(BASE_A): $(OBJ_C) $(OBJ_LIBDVDCSS)
-       ar r $@ $^
-       $(RANLIB) $@
-
diff --git a/extras/libdvdcss/css.c b/extras/libdvdcss/css.c
deleted file mode 100644 (file)
index b2cef9f..0000000
+++ /dev/null
@@ -1,1204 +0,0 @@
-/*****************************************************************************
- * css.c: Functions for DVD authentification and unscrambling
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: css.c,v 1.22 2002/01/23 03:15:31 stef Exp $
- *
- * Author: Stéphane Borel <stef@via.ecp.fr>
- *         Håkan Hjort <d95hjort@dtek.chalmers.se>
- *
- * based on:
- *  - css-auth by Derek Fawcus <derek@spider.com>
- *  - DVD CSS ioctls example program by Andrew T. Veliath <andrewtv@usa.net>
- *  - The Divide and conquer attack by Frank A. Stevenson <frank@funcom.com>
- *  - DeCSSPlus by Ethan Hawke
- *  - DecVOB
- *  see http://www.lemuria.org/DeCSS/ by Tom Vogt for more information.
- * 
- * 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, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <string.h>
-
-#include <videolan/vlc.h>
-
-#include "videolan/dvdcss.h"
-#include "libdvdcss.h"
-
-#include "csstables.h"
-#include "ioctl.h"
-
-#ifdef HAVE_CSSKEYS
-#  include "csskeys.h"
-#endif
-
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int  CSSAuth      ( dvdcss_handle dvdcss );
-static int  CSSGetASF    ( dvdcss_handle dvdcss );
-static void CSSCryptKey  ( int i_key_type, int i_varient,
-                           u8 const * p_challenge, u8* p_key );
-static void CSSDecryptKey( u8* p_crypted, u8* p_key, u8 );
-static int  CSSDiscCrack ( dvdcss_handle dvdcss, u8 * p_disc_key );
-static int  CSSTitleCrack( int i_start, unsigned char * p_crypted,
-                           unsigned char * p_decrypted,
-                           dvd_key_t * p_sector_key, dvd_key_t * p_key );
-
-/*****************************************************************************
- * CSSTest : check if the disc is encrypted or not
- *****************************************************************************/
-int CSSTest( dvdcss_handle dvdcss )
-{
-    int i_ret, i_copyright;
-
-    i_ret = ioctl_ReadCopyright( dvdcss->i_fd, 0 /* i_layer */, &i_copyright );
-
-    if( i_ret < 0 )
-    {
-        /* Since it's the first ioctl we try to issue, we add a notice */
-        _dvdcss_error( dvdcss, "css error: ioctl_ReadCopyright failed, "
-                       "make sure there is a DVD in the drive, and that "
-                       "DVD ioctls were compiled in this libdvdcss version."
-#if defined( WIN32 )
-                       "\nAlso note that if you are using Windows NT/2000/XP "
-                       "you need to have administrator priviledges to be able "
-                       "to use ioctls."
-#endif
-                     );
-
-        return i_ret;
-    }
-
-    return i_copyright;
-}
-
-/*****************************************************************************
- * CSSAuth : DVD CSS authentication.
- *****************************************************************************
- * It simulates the mutual authentication between logical unit and host,
- * and stops when a session key (called bus key) has been established.
- * Always do the full auth sequence. Some drives seem to lie and always
- * respond with ASF=1.  For instance the old DVD roms on Compaq Armada says
- * that ASF=1 from the start and then later fail with a 'read of scrambled 
- * block without authentication' error.
- *****************************************************************************/
-static int CSSAuth( dvdcss_handle dvdcss )
-{
-    u8        p_buffer[10];
-    u8        p_challenge[2*KEY_SIZE];
-    dvd_key_t p_key1;
-    dvd_key_t p_key2;
-    dvd_key_t p_key_check;
-    u8        i_varient = 0;
-    char      psz_warning[48];
-    int       i_ret = -1;
-    int       i;
-
-    /* So this isn't really necessary except for debuging. */ 
-    if( CSSGetASF( dvdcss ) < 0 )
-    {
-        _dvdcss_error( dvdcss, "fatal error in CSSAuth" );
-        // ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
-        return -1;
-    }
-
-    _dvdcss_debug( dvdcss, "requesting AGID" );
-    i_ret = ioctl_ReportAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
-
-    /* We might have to reset hung authentication processes in the drive 
-       by invalidating the corresponding AGID'.  As long as we haven't got
-       an AGID, invalidate one (in sequence) and try again. */
-    for( i = 0; i_ret == -1 && i < 4 ; ++i )
-      {
-        _dvdcss_debug( dvdcss, "ioctl_ReportAgid failed" );
-        
-        sprintf( psz_warning, "invalidating AGID %d", i );
-        _dvdcss_debug( dvdcss, psz_warning );
-        
-        /* This is really _not good_, should be handled by the OS.
-           Invalidating an AGID could make another process fail some
-           where in it's authentication process. */
-        dvdcss->css.i_agid = i;
-        ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
-        
-        _dvdcss_debug( dvdcss, "requesting AGID" );
-        i_ret = ioctl_ReportAgid( dvdcss->i_fd, &dvdcss->css.i_agid );
-    }
-
-    /* Unable to authenticate without AGID */
-    if( i_ret == -1 )
-    {
-        _dvdcss_error( dvdcss, "ioctl_ReportAgid failed, fatal" );
-        return -1;
-    }
-
-    /* Setup a challenge, any valuse should work */
-    for( i = 0 ; i < 10; ++i )
-    {
-        p_challenge[i] = i;
-    }
-
-    /* Get challenge from host */
-    for( i = 0 ; i < 10 ; ++i )
-    {
-        p_buffer[9-i] = p_challenge[i];
-    }
-
-    /* Send challenge to LU */
-    if( ioctl_SendChallenge( dvdcss->i_fd, &dvdcss->css.i_agid, p_buffer ) < 0 )
-    {
-        _dvdcss_error( dvdcss, "ioctl_SendChallenge failed" );
-        // ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
-        return -1;
-    }
-
-    /* Get key1 from LU */
-    if( ioctl_ReportKey1( dvdcss->i_fd, &dvdcss->css.i_agid, p_buffer ) < 0)
-    {
-        _dvdcss_error( dvdcss, "ioctl_ReportKey1 failed" );
-        // ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
-        return -1;
-    }
-
-    /* Send key1 to host */
-    for( i = 0 ; i < KEY_SIZE ; i++ )
-    {
-        p_key1[i] = p_buffer[4-i];
-    }
-
-    for( i = 0 ; i < 32 ; ++i )
-    {
-        CSSCryptKey( 0, i, p_challenge, p_key_check );
-
-        if( memcmp( p_key_check, p_key1, KEY_SIZE ) == 0 )
-        {
-            snprintf( psz_warning, sizeof(psz_warning),
-                      "drive authentic, using varient %d", i );
-            _dvdcss_debug( dvdcss, psz_warning );
-            i_varient = i;
-            break;
-        }
-    }
-
-    if( i == 32 )
-    {
-        _dvdcss_error( dvdcss, "drive would not authenticate" );
-        // ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
-        return -1;
-    }
-
-    /* Get challenge from LU */
-    if( ioctl_ReportChallenge( dvdcss->i_fd, 
-                               &dvdcss->css.i_agid, p_buffer ) < 0 )
-    {
-        _dvdcss_error( dvdcss, "ioctl_ReportKeyChallenge failed" );
-        // ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
-        return -1;
-    }
-
-    /* Send challenge to host */
-    for( i = 0 ; i < 10 ; ++i )
-    {
-        p_challenge[i] = p_buffer[9-i];
-    }
-
-    CSSCryptKey( 1, i_varient, p_challenge, p_key2 );
-
-    /* Get key2 from host */
-    for( i = 0 ; i < KEY_SIZE ; ++i )
-    {
-        p_buffer[4-i] = p_key2[i];
-    }
-
-    /* Send key2 to LU */
-    if( ioctl_SendKey2( dvdcss->i_fd, &dvdcss->css.i_agid, p_buffer ) < 0 )
-    {
-        _dvdcss_error( dvdcss, "ioctl_SendKey2 failed" );
-        // ioctl_InvalidateAgid( dvdcss->i_fd, &dvdcss->css.i_agid ); ??
-        return -1;
-    }
-
-    /* The drive has accepted us as authentic. */
-    _dvdcss_debug( dvdcss, "authentication established" );
-
-    memcpy( p_challenge, p_key1, KEY_SIZE );
-    memcpy( p_challenge + KEY_SIZE, p_key2, KEY_SIZE );
-
-    CSSCryptKey( 2, i_varient, p_challenge, dvdcss->css.p_bus_key );
-
-    return 0;
-}
-
-/*****************************************************************************
- * CSSPrintKey : debug function that dumps a key value 
- *****************************************************************************/static void CSSPrintKey( dvdcss_handle dvdcss, u8* data )
-{
-    char psz_output[80];
-
-    sprintf( psz_output, "the key is %02x %02x %02x %02x %02x",
-             data[0], data[1], data[2], data[3], data[4] );
-    _dvdcss_debug( dvdcss, psz_output );
-}
-
-/*****************************************************************************
- * CSSGetDiscKey : get disc key and optionnaly decrypts it.
- *****************************************************************************
- * This function should only be called if DVD ioctls are present.
- * Two decryption methods are then offered:
- *  -disc key hash crack,
- *  -decryption with player keys if they are available.
- *****************************************************************************/
-int CSSGetDiscKey( dvdcss_handle dvdcss )
-{
-    unsigned char   p_buffer[2048];
-#ifdef HAVE_CSSKEYS
-    dvd_key_t       disc_key;
-    dvd_key_t       test_key;
-#endif
-    int i;
-
-    if( CSSAuth( dvdcss ) )
-    {
-        return -1;
-    }
-
-    /* Get encrypted disc key */
-    if( ioctl_ReadDiscKey( dvdcss->i_fd, &dvdcss->css.i_agid, p_buffer ) < 0 )
-    {
-        _dvdcss_error( dvdcss, "ioctl_ReadDiscKey failed" );
-        return -1;
-    }
-
-    /* Unencrypt disc key using bus key */
-    for( i = 0 ; i < 2048 ; i++ )
-    {
-        p_buffer[ i ] ^= dvdcss->css.p_bus_key[ 4 - (i % KEY_SIZE) ];
-    }
-
-    switch( dvdcss->i_method )
-    {
-        case DVDCSS_METHOD_KEY:
-#ifdef HAVE_CSSKEYS
-            /* Decrypt disc key with player keys from csskeys.h */
-            _dvdcss_debug( dvdcss, "decrypting disc key with player keys" );
-            i = 0;
-            do
-            {
-                /* Take encrypted disc key and decrypt it */
-                memcpy( disc_key,
-                        p_buffer + playerkeys[i].i_offset,
-                        KEY_SIZE );
-                CSSDecryptKey( disc_key, playerkeys[i].p_key, 0 );
-
-                /* Encrypt disc key hash with disc key to
-                 * check we have disc key */
-                memcpy( test_key, p_buffer, KEY_SIZE );
-                CSSDecryptKey( test_key, disc_key, 0);
-
-                i++;
-
-            } while( ( playerkeys[i].i_offset != -1 ) &&
-                     ( memcmp( test_key, disc_key, KEY_SIZE ) ) );
-
-            /* The decrypted disk key will replace the disk key hash */
-            memcpy( dvdcss->css.p_disc_key, disc_key, KEY_SIZE );
-            break;
-#else
-            dvdcss->i_method = DVDCSS_METHOD_DISC;            
-#endif
-        case DVDCSS_METHOD_DISC:
-            /* Crack Disc key to be able to use it */
-            _dvdcss_debug( dvdcss, "cracking disc key with key hash" );
-            _dvdcss_debug( dvdcss, "building 64MB table ... this will take some time" );
-            CSSDiscCrack( dvdcss, p_buffer );
-            memcpy( dvdcss->css.p_disc_key, p_buffer, KEY_SIZE );
-            break;
-
-        default:
-            _dvdcss_debug( dvdcss, "disc key won't be decrypted" );
-    }
-
-    CSSPrintKey( dvdcss, dvdcss->css.p_disc_key );
-    return 0;
-}
-
-
-/*****************************************************************************
- * CSSGetTitleKey : get title key.
- *****************************************************************************/
-int CSSGetTitleKey( dvdcss_handle dvdcss, int i_pos )
-{
-    dvd_key_t   p_key;
-    int         i,j;
-
-    if( ( dvdcss->i_method == DVDCSS_METHOD_TITLE )
-        || ( dvdcss->b_ioctls == 0 ) )
-    {
-        /*
-         * Title key cracking method from Ethan Hawke,
-         * with Frank A. Stevenson algorithm.
-         * Does not use any player key table and ioctls.
-         */
-        u8          p_buf[0x800];
-        u8          p_packstart[4] = { 0x00, 0x00, 0x01, 0xba };
-        boolean_t   b_encrypted;
-        boolean_t   b_stop_scanning;
-        int         i_blocks_read;
-        int         i_best_plen;
-        int         i_best_p;
-
-        _dvdcss_debug( dvdcss, "cracking title key ... this may take some time" );
-
-        for( i = 0 ; i < KEY_SIZE ; i++ )
-        {
-            p_key[i] = 0;
-        }
-
-        b_encrypted = 0;
-        b_stop_scanning = 0;
-        i_blocks_read = 0;
-
-        do
-        {
-            i_pos = _dvdcss_seek( dvdcss, i_pos );
-            if( _dvdcss_read( dvdcss, p_buf, 1 ) != 1 ) break;
-
-            /* Stop when we find a non MPEG stream block */
-            if( memcmp( p_buf, p_packstart, 4 ) )
-            {
-                /* The title is unencrypted */
-                if( !b_encrypted )
-                    break;
-                /* dvdcss some times fail to find/crack the key, 
-                   hope that it's the same as the one in the next title
-                   _dvdcss_debug( dvdcss, "no key found at end of title" );
-                */
-            }
-
-            /* PES_scrambling_control on and make sure that the packet type 
-               is one that can be scrambled */
-            if( p_buf[0x14] & 0x30  && ! ( p_buf[0x11] == 0xbb 
-                                           || p_buf[0x11] == 0xbe  
-                                           || p_buf[0x11] == 0xbf ) )
-            {
-                b_encrypted = 1;
-                i_best_plen = 0;
-                i_best_p = 0;
-
-                for( i = 2 ; i < 0x30 ; i++ )
-                {
-                    for( j = i+1 ;
-                         j < 0x80 && ( p_buf[0x7F - (j%i)] == p_buf[0x7F-j] );
-                         j++ );
-                    {
-                        if( j > i_best_plen )
-                        {
-                            i_best_plen = j;
-                            i_best_p = i;
-                        }
-                    }
-                }
-
-                if( ( i_best_plen > 20 ) && ( i_best_plen / i_best_p >= 2) )
-                {
-                    i = CSSTitleCrack( 0,  &p_buf[0x80],
-                            &p_buf[0x80 - ( i_best_plen / i_best_p) *i_best_p],
-                            (dvd_key_t*)&p_buf[0x54],
-                            &p_key );
-                    b_stop_scanning = ( i >= 0 );
-                }
-            }
-
-            i_pos += 1;
-            i_blocks_read += 1;
-
-            /* If we haven't seen any encrypted ones after 3000 blocks stop */
-            if( !b_encrypted && i_blocks_read >= 1000 ) break;
-
-        } while( !b_stop_scanning );
-
-        if( b_stop_scanning )
-        {
-            memcpy( dvdcss->css.p_title_key, &p_key, sizeof(dvd_key_t) );
-            CSSPrintKey( dvdcss, dvdcss->css.p_title_key );
-            _dvdcss_debug( dvdcss, "vts key initialized" );
-            return 0;
-        }
-
-        if( !b_encrypted )
-        {
-            _dvdcss_debug( dvdcss, "file was unscrambled" );
-            dvdcss->b_encrypted = 0;
-            return 0;
-        }
-
-        return -1;
-    }
-    else
-    {
-        /* 
-         * if we are here we have a decrypted disc key and ioctls are available
-         * so we can read the title key and decrypt it.
-         */
-
-        _dvdcss_debug( dvdcss, "decrypting title key with disc key" );
-
-        /* We need to authenticate again for every key
-         * (to get a new session key ?) */
-        CSSAuth( dvdcss );
-
-        /* Get encrypted title key */
-        if( ioctl_ReadTitleKey( dvdcss->i_fd, &dvdcss->css.i_agid,
-                                i_pos, p_key ) < 0 )
-        {
-            _dvdcss_error( dvdcss, "ioctl_ReadTitleKey failed" );
-            return -1;
-        }
-
-        if( memcmp( p_key, dvdcss->css.p_unenc_key, KEY_SIZE ) )
-        {
-            memcpy( dvdcss->css.p_unenc_key, p_key, KEY_SIZE );
-            
-            /* Unencrypt title key using bus key */
-            for( i = 0 ; i < KEY_SIZE ; i++ )
-            {
-                p_key[ i ] ^= dvdcss->css.p_bus_key[ 4 - (i % KEY_SIZE ) ];
-            }
-
-            /* If p_key is all zero then there realy wasn't any key pressent. */
-            if( !( p_key[0] | p_key[1] | p_key[2] | p_key[3] | p_key[4] ) )
-            {
-                memset( dvdcss->css.p_title_key, 0, sizeof(dvd_key_t) );
-                CSSPrintKey( dvdcss, dvdcss->css.p_title_key );
-                return 0;
-            }        
-
-            /* Title key decryption needs one inversion 0xff */
-            CSSDecryptKey( p_key, dvdcss->css.p_disc_key, 0xff );
-
-            memcpy( dvdcss->css.p_title_key, p_key, KEY_SIZE );
-            CSSPrintKey( dvdcss, dvdcss->css.p_title_key );
-        }
-
-        return 0;
-    } // (dvdcss->i_method == DVDCSS_METHOD_TITLE) || (dvdcss->b_ioctls == 0)
-}
-
-/*****************************************************************************
- * CSSDescrambleSector: does the actual descrambling of data
- *****************************************************************************
- * sec : sector to descramble
- * key : title key for this sector
- *****************************************************************************/
-int CSSDescrambleSector( dvd_key_t p_key, u8* p_sec )
-{
-    unsigned int    i_t1, i_t2, i_t3, i_t4, i_t5, i_t6;
-    u8*             p_end = p_sec + 0x800;
-
-    /* PES_scrambling_control */
-    if( p_sec[0x14] & 0x30)
-    {
-        i_t1 = ((p_key)[0] ^ p_sec[0x54]) | 0x100;
-        i_t2 = (p_key)[1] ^ p_sec[0x55];
-        i_t3 = (((p_key)[2]) | ((p_key)[3] << 8) |
-               ((p_key)[4] << 16)) ^ ((p_sec[0x56]) |
-               (p_sec[0x57] << 8) | (p_sec[0x58] << 16));
-        i_t4 = i_t3 & 7;
-        i_t3 = i_t3 * 2 + 8 - i_t4;
-        p_sec += 0x80;
-        i_t5 = 0;
-
-        while( p_sec != p_end )
-        {
-            i_t4 = p_css_tab2[i_t2] ^ p_css_tab3[i_t1];
-            i_t2 = i_t1>>1;
-            i_t1 = ( ( i_t1 & 1 ) << 8 ) ^ i_t4;
-            i_t4 = p_css_tab5[i_t4];
-            i_t6 = ((((((( i_t3 >> 3 ) ^ i_t3 ) >> 1 ) ^
-                                         i_t3 ) >> 8 ) ^ i_t3 ) >> 5 ) & 0xff;
-            i_t3 = (i_t3 << 8 ) | i_t6;
-            i_t6 = p_css_tab4[i_t6];
-            i_t5 += i_t6 + i_t4;
-            *p_sec = p_css_tab1[*p_sec] ^( i_t5 & 0xff );
-            p_sec++;
-            i_t5 >>= 8;
-        }
-    }
-
-    return 0;
-}
-
-/* Following functions are local */
-
-/*****************************************************************************
- * CSSGetASF : Get Authentification success flag
- *****************************************************************************
- * Returns :
- *  -1 on ioctl error,
- *  0 if the device needs to be authenticated,
- *  1 either.
- *****************************************************************************/
-static int CSSGetASF( dvdcss_handle dvdcss )
-{
-    int i_asf = 0;
-
-    if( ioctl_ReportASF( dvdcss->i_fd, NULL, &i_asf ) != 0 )
-    {
-        /* The ioctl process has failed */
-        _dvdcss_error( dvdcss, "GetASF fatal error" );
-        return -1;
-    }
-
-    if( i_asf )
-    {
-        _dvdcss_debug( dvdcss, "GetASF authenticated (ASF=1)" );
-    }
-    else
-    {
-        _dvdcss_debug( dvdcss, "GetASF not authenticated (ASF=0)" );
-    }
-
-    return i_asf;
-}
-
-/*****************************************************************************
- * CSSCryptKey : shuffles bits and unencrypt keys.
- *****************************************************************************
- * Used during authentication and disc key negociation in CSSAuth.
- * i_key_type : 0->key1, 1->key2, 2->buskey.
- * i_varient : between 0 and 31.
- *****************************************************************************/
-static void CSSCryptKey( int i_key_type, int i_varient,
-                         u8 const * p_challenge, u8* p_key )
-{
-    /* Permutation table for challenge */
-    u8      pp_perm_challenge[3][10] =
-            { { 1, 3, 0, 7, 5, 2, 9, 6, 4, 8 },
-              { 6, 1, 9, 3, 8, 5, 7, 4, 0, 2 },
-              { 4, 0, 3, 5, 7, 2, 8, 6, 1, 9 } };
-
-    /* Permutation table for varient table for key2 and buskey */
-    u8      pp_perm_varient[2][32] =
-            { { 0x0a, 0x08, 0x0e, 0x0c, 0x0b, 0x09, 0x0f, 0x0d,
-                0x1a, 0x18, 0x1e, 0x1c, 0x1b, 0x19, 0x1f, 0x1d,
-                0x02, 0x00, 0x06, 0x04, 0x03, 0x01, 0x07, 0x05,
-                0x12, 0x10, 0x16, 0x14, 0x13, 0x11, 0x17, 0x15 },
-              { 0x12, 0x1a, 0x16, 0x1e, 0x02, 0x0a, 0x06, 0x0e,
-                0x10, 0x18, 0x14, 0x1c, 0x00, 0x08, 0x04, 0x0c,
-                0x13, 0x1b, 0x17, 0x1f, 0x03, 0x0b, 0x07, 0x0f,
-                0x11, 0x19, 0x15, 0x1d, 0x01, 0x09, 0x05, 0x0d } };
-
-    u8      p_varients[32] =
-            {   0xB7, 0x74, 0x85, 0xD0, 0xCC, 0xDB, 0xCA, 0x73,
-                0x03, 0xFE, 0x31, 0x03, 0x52, 0xE0, 0xB7, 0x42,
-                0x63, 0x16, 0xF2, 0x2A, 0x79, 0x52, 0xFF, 0x1B,
-                0x7A, 0x11, 0xCA, 0x1A, 0x9B, 0x40, 0xAD, 0x01 };
-
-    /* The "secret" key */
-    u8      p_secret[5] = { 0x55, 0xD6, 0xC4, 0xC5, 0x28 };
-
-    u8      p_bits[30];
-    u8      p_scratch[10];
-    u8      p_tmp1[5];
-    u8      p_tmp2[5];
-    u8      i_lfsr0_o;  /* 1 bit used */
-    u8      i_lfsr1_o;  /* 1 bit used */
-    u32     i_lfsr0;
-    u32     i_lfsr1;
-    u8      i_css_varient;
-    u8      i_cse;
-    u8      i_index;
-    u8      i_combined;
-    u8      i_carry;
-    u8      i_val = 0;
-    int     i_term = 0;
-    int     i_bit;
-    int     i;
-
-    for (i = 9; i >= 0; --i)
-        p_scratch[i] = p_challenge[pp_perm_challenge[i_key_type][i]];
-
-    i_css_varient = ( i_key_type == 0 ) ? i_varient :
-                    pp_perm_varient[i_key_type-1][i_varient];
-
-    /*
-     * This encryption engine implements one of 32 variations
-     * one the same theme depending upon the choice in the
-     * varient parameter (0 - 31).
-     *
-     * The algorithm itself manipulates a 40 bit input into
-     * a 40 bit output.
-     * The parameter 'input' is 80 bits.  It consists of
-     * the 40 bit input value that is to be encrypted followed
-     * by a 40 bit seed value for the pseudo random number
-     * generators.
-     */
-
-    /* Feed the secret into the input values such that
-     * we alter the seed to the LFSR's used above,  then
-     * generate the bits to play with.
-     */
-    for( i = 5 ; --i >= 0 ; )
-    {
-        p_tmp1[i] = p_scratch[5 + i] ^ p_secret[i] ^ p_crypt_tab2[i];
-    }
-
-    /*
-     * We use two LFSR's (seeded from some of the input data bytes) to
-     * generate two streams of pseudo-random bits.  These two bit streams
-     * are then combined by simply adding with carry to generate a final
-     * sequence of pseudo-random bits which is stored in the buffer that
-     * 'output' points to the end of - len is the size of this buffer.
-     *
-     * The first LFSR is of degree 25,  and has a polynomial of:
-     * x^13 + x^5 + x^4 + x^1 + 1
-     *
-     * The second LSFR is of degree 17,  and has a (primitive) polynomial of:
-     * x^15 + x^1 + 1
-     *
-     * I don't know if these polynomials are primitive modulo 2,  and thus
-     * represent maximal-period LFSR's.
-     *
-     *
-     * Note that we take the output of each LFSR from the new shifted in
-     * bit,  not the old shifted out bit.  Thus for ease of use the LFSR's
-     * are implemented in bit reversed order.
-     *
-     */
-    
-    /* In order to ensure that the LFSR works we need to ensure that the
-     * initial values are non-zero.  Thus when we initialise them from
-     * the seed,  we ensure that a bit is set.
-     */
-    i_lfsr0 = ( p_tmp1[0] << 17 ) | ( p_tmp1[1] << 9 ) |
-              (( p_tmp1[2] & ~7 ) << 1 ) | 8 | ( p_tmp1[2] & 7 );
-    i_lfsr1 = ( p_tmp1[3] << 9 ) | 0x100 | p_tmp1[4];
-
-    i_index = sizeof(p_bits);
-    i_carry = 0;
-
-    do
-    {
-        for( i_bit = 0, i_val = 0 ; i_bit < 8 ; ++i_bit )
-        {
-
-            i_lfsr0_o = ( ( i_lfsr0 >> 24 ) ^ ( i_lfsr0 >> 21 ) ^
-                        ( i_lfsr0 >> 20 ) ^ ( i_lfsr0 >> 12 ) ) & 1;
-            i_lfsr0 = ( i_lfsr0 << 1 ) | i_lfsr0_o;
-
-            i_lfsr1_o = ( ( i_lfsr1 >> 16 ) ^ ( i_lfsr1 >> 2 ) ) & 1;
-            i_lfsr1 = ( i_lfsr1 << 1 ) | i_lfsr1_o;
-
-            i_combined = !i_lfsr1_o + i_carry + !i_lfsr0_o;
-            /* taking bit 1 */
-            i_carry = ( i_combined >> 1 ) & 1;
-            i_val |= ( i_combined & 1 ) << i_bit;
-        }
-    
-        p_bits[--i_index] = i_val;
-    } while( i_index > 0 );
-
-    /* This term is used throughout the following to
-     * select one of 32 different variations on the
-     * algorithm.
-     */
-    i_cse = p_varients[i_css_varient] ^ p_crypt_tab2[i_css_varient];
-
-    /* Now the actual blocks doing the encryption.  Each
-     * of these works on 40 bits at a time and are quite
-     * similar.
-     */
-    i_index = 0;
-    for( i = 5, i_term = 0 ; --i >= 0 ; i_term = p_scratch[i] )
-    {
-        i_index = p_bits[25 + i] ^ p_scratch[i];
-        i_index = p_crypt_tab1[i_index] ^ ~p_crypt_tab2[i_index] ^ i_cse;
-
-        p_tmp1[i] = p_crypt_tab2[i_index] ^ p_crypt_tab3[i_index] ^ i_term;
-    }
-    p_tmp1[4] ^= p_tmp1[0];
-
-    for( i = 5, i_term = 0 ; --i >= 0 ; i_term = p_tmp1[i] )
-    {
-        i_index = p_bits[20 + i] ^ p_tmp1[i];
-        i_index = p_crypt_tab1[i_index] ^ ~p_crypt_tab2[i_index] ^ i_cse;
-
-        p_tmp2[i] = p_crypt_tab2[i_index] ^ p_crypt_tab3[i_index] ^ i_term;
-    }
-    p_tmp2[4] ^= p_tmp2[0];
-
-    for( i = 5, i_term = 0 ; --i >= 0 ; i_term = p_tmp2[i] )
-    {
-        i_index = p_bits[15 + i] ^ p_tmp2[i];
-        i_index = p_crypt_tab1[i_index] ^ ~p_crypt_tab2[i_index] ^ i_cse;
-        i_index = p_crypt_tab2[i_index] ^ p_crypt_tab3[i_index] ^ i_term;
-
-        p_tmp1[i] = p_crypt_tab0[i_index] ^ p_crypt_tab2[i_index];
-    }
-    p_tmp1[4] ^= p_tmp1[0];
-
-    for( i = 5, i_term = 0 ; --i >= 0 ; i_term = p_tmp1[i] )
-    {
-        i_index = p_bits[10 + i] ^ p_tmp1[i];
-        i_index = p_crypt_tab1[i_index] ^ ~p_crypt_tab2[i_index] ^ i_cse;
-
-        i_index = p_crypt_tab2[i_index] ^ p_crypt_tab3[i_index] ^ i_term;
-
-        p_tmp2[i] = p_crypt_tab0[i_index] ^ p_crypt_tab2[i_index];
-    }
-    p_tmp2[4] ^= p_tmp2[0];
-
-    for( i = 5, i_term = 0 ; --i >= 0 ; i_term = p_tmp2[i] )
-    {
-        i_index = p_bits[5 + i] ^ p_tmp2[i];
-        i_index = p_crypt_tab1[i_index] ^ ~p_crypt_tab2[i_index] ^ i_cse;
-
-        p_tmp1[i] = p_crypt_tab2[i_index] ^ p_crypt_tab3[i_index] ^ i_term;
-    }
-    p_tmp1[4] ^= p_tmp1[0];
-
-    for(i = 5, i_term = 0 ; --i >= 0 ; i_term = p_tmp1[i] )
-    {
-        i_index = p_bits[i] ^ p_tmp1[i];
-        i_index = p_crypt_tab1[i_index] ^ ~p_crypt_tab2[i_index] ^ i_cse;
-
-        p_key[i] = p_crypt_tab2[i_index] ^ p_crypt_tab3[i_index] ^ i_term;
-    }
-
-    return;
-}
-
-/*****************************************************************************
- * CSSDecryptKey: decrypt p_crypted with p_key.
- *****************************************************************************
- * Decryption is slightly dependant on the type of key:
- *  -for disc key, invert is 0x00,
- *  -for title key, invert if 0xff. 
- *****************************************************************************/
-static void CSSDecryptKey( u8* p_crypted, u8* p_key, u8 invert )
-{
-    unsigned int    i_lfsr1_lo;
-    unsigned int    i_lfsr1_hi;
-    unsigned int    i_lfsr0;
-    unsigned int    i_combined;
-    byte_t          o_lfsr0;
-    byte_t          o_lfsr1;
-    byte_t          k[5];
-    int             i;
-
-    i_lfsr1_lo = p_key[0] | 0x100;
-    i_lfsr1_hi = p_key[1];
-
-    i_lfsr0    = ( ( p_key[4] << 17 )
-                 | ( p_key[3] << 9 )
-                 | ( p_key[2] << 1 ) )
-                 + 8 - ( p_key[2] & 7 );
-    i_lfsr0    = ( p_css_tab4[i_lfsr0 & 0xff] << 24 ) |
-                 ( p_css_tab4[( i_lfsr0 >> 8 ) & 0xff] << 16 ) |
-                 ( p_css_tab4[( i_lfsr0 >> 16 ) & 0xff] << 8 ) |
-                   p_css_tab4[( i_lfsr0 >> 24 ) & 0xff];
-
-    i_combined = 0;
-    for( i = 0 ; i < KEY_SIZE ; ++i )
-    {
-        o_lfsr1     = p_css_tab2[i_lfsr1_hi] ^ p_css_tab3[i_lfsr1_lo];
-        i_lfsr1_hi  = i_lfsr1_lo >> 1;
-        i_lfsr1_lo  = ( ( i_lfsr1_lo & 1 ) << 8 ) ^ o_lfsr1;
-        o_lfsr1     = p_css_tab4[o_lfsr1];
-
-        o_lfsr0 = ((((((( i_lfsr0 >> 8 ) ^ i_lfsr0 ) >> 1 )
-                        ^ i_lfsr0 ) >> 3 ) ^ i_lfsr0 ) >> 7 );
-        i_lfsr0 = ( i_lfsr0 >> 8 ) | ( o_lfsr0 << 24 );
-
-        i_combined += ( o_lfsr0 ^ invert ) + o_lfsr1;
-        k[i] = i_combined & 0xff;
-        i_combined >>= 8;
-    }
-
-    p_crypted[4] = k[4] ^ p_css_tab1[p_crypted[4]] ^ p_crypted[3];
-    p_crypted[3] = k[3] ^ p_css_tab1[p_crypted[3]] ^ p_crypted[2];
-    p_crypted[2] = k[2] ^ p_css_tab1[p_crypted[2]] ^ p_crypted[1];
-    p_crypted[1] = k[1] ^ p_css_tab1[p_crypted[1]] ^ p_crypted[0];
-    p_crypted[0] = k[0] ^ p_css_tab1[p_crypted[0]] ^ p_crypted[4];
-
-    p_crypted[4] = k[4] ^ p_css_tab1[p_crypted[4]] ^ p_crypted[3];
-    p_crypted[3] = k[3] ^ p_css_tab1[p_crypted[3]] ^ p_crypted[2];
-    p_crypted[2] = k[2] ^ p_css_tab1[p_crypted[2]] ^ p_crypted[1];
-    p_crypted[1] = k[1] ^ p_css_tab1[p_crypted[1]] ^ p_crypted[0];
-    p_crypted[0] = k[0] ^ p_css_tab1[p_crypted[0]];
-
-    return;
-}
-
-/*****************************************************************************
- * CSSDiscCrack: brute force disc key
- * CSS hash reversal function designed by Frank Stevenson
- *****************************************************************************
- * This function uses a big amount of memory to crack the disc key from the   
- * disc key hash, if player keys are not available.
- *****************************************************************************/
-#define K1TABLEWIDTH 10
-
-/*
- * Simple function to test if a candidate key produces the given hash
- */
-static int investigate( unsigned char* hash, unsigned char *ckey )
-{
-    unsigned char key[5];
-    unsigned char pkey[5];
-
-    memcpy( key, hash, 5 );
-    memcpy( pkey, ckey, 5 );
-
-    CSSDecryptKey( key, pkey, 0 );
-
-    return memcmp( key, pkey, 5 );
-}
-
-static int CSSDiscCrack( dvdcss_handle dvdcss, u8 * p_disc_key )
-{
-    unsigned char B[5] = { 0,0,0,0,0 }; /* Second Stage of mangle cipher */
-    unsigned char C[5] = { 0,0,0,0,0 }; /* Output Stage of mangle cipher
-                                         * IntermediateKey */
-    unsigned char k[5] = { 0,0,0,0,0 }; /* Mangling cipher key
-                                         * Also output from CSS( C ) */
-    unsigned char out1[5];              /* five first output bytes of LFSR1 */
-    unsigned char out2[5];              /* five first output bytes of LFSR2 */
-    unsigned int lfsr1a;                /* upper 9 bits of LFSR1 */
-    unsigned int lfsr1b;                /* lower 8 bits of LFSR1 */
-    unsigned int tmp, tmp2, tmp3, tmp4,tmp5;
-    int i,j;
-    unsigned int nStepA;        /* iterator for LFSR1 start state */
-    unsigned int nStepB;        /* iterator for possible B[0]     */
-    unsigned int nTry;          /* iterator for K[1] possibilities */
-    unsigned int nPossibleK1;   /* #of possible K[1] values */
-    unsigned char* K1table;     /* Lookup table for possible K[1] */
-    unsigned int*  BigTable;    /* LFSR2 startstate indexed by 
-                                 * 1,2,5 output byte */
-
-    /*
-     * Prepare tables for hash reversal
-     */
-
-    
-    /* initialize lookup tables for k[1] */
-    K1table = malloc( 65536 * K1TABLEWIDTH );
-    memset( K1table, 0 , 65536 * K1TABLEWIDTH );
-    if( K1table == NULL )
-    {
-        return -1;
-    }
-
-    tmp = p_disc_key[0] ^ p_css_tab1[ p_disc_key[1] ];
-    for( i = 0 ; i < 256 ; i++ ) /* k[1] */
-    {
-        tmp2 = p_css_tab1[ tmp ^ i ]; /* p_css_tab1[ B[1] ]*/
-
-        for( j = 0 ; j < 256 ; j++ ) /* B[0] */
-        {
-            tmp3 = j ^ tmp2 ^ i; /* C[1] */
-            tmp4 = K1table[ K1TABLEWIDTH * ( 256 * j + tmp3 ) ]; /* count of entries  here */
-            tmp4++;
-/*
-            if( tmp4 == K1TABLEWIDTH )
-            {
-                _dvdcss_debug( dvdcss, "Table disaster %d", tmp4 );
-            }
-*/
-            if( tmp4 < K1TABLEWIDTH )
-            {
-                K1table[ K1TABLEWIDTH * ( 256 * j + tmp3 ) +    tmp4 ] = i;
-            }
-            K1table[ K1TABLEWIDTH * ( 256 * j + tmp3 ) ] = tmp4;
-        }
-    }
-
-    /* Initing our Really big table */
-    BigTable = malloc( 16777216 * sizeof(int) );
-    memset( BigTable, 0 , 16777216 * sizeof(int) );
-    if( BigTable == NULL )
-    {
-        return -1;
-    }
-
-    tmp3 = 0;
-
-    _dvdcss_debug( dvdcss, "initializing the big table" );
-
-    for( i = 0 ; i < 16777216 ; i++ )
-    {
-/*
-        if( ( i & 0x07ffff ) == 0 )
-        {
-            fprintf( stderr, "#" );
-        }
-*/
-        tmp = (( i + i ) & 0x1fffff0 ) | 0x8 | ( i & 0x7 );
-
-        for( j = 0 ; j < 5 ; j++ )
-        {
-            tmp2=((((((( tmp >> 3 ) ^ tmp ) >> 1 ) ^ tmp ) >> 8 )
-                                    ^ tmp ) >> 5 ) & 0xff;
-            tmp = ( tmp << 8) | tmp2;
-            out2[j] = p_css_tab4[ tmp2 ];
-        }
-
-        j = ( out2[0] << 16 ) | ( out2[1] << 8 ) | out2[4];
-        BigTable[j] = i;
-    }
-
-/*    fprintf( stderr, "\n" ); */
-
-    /*
-     * We are done initing, now reverse hash
-     */
-    tmp5 = p_disc_key[0] ^ p_css_tab1[ p_disc_key[1] ];
-
-    for( nStepA = 0 ; nStepA < 65536 ; nStepA ++ )
-    {
-        lfsr1a = 0x100 | ( nStepA >> 8 );
-        lfsr1b = nStepA & 0xff;
-
-        /* Generate 5 first output bytes from lfsr1 */
-        for( i = 0 ; i < 5 ; i++ )
-        {
-            tmp = p_css_tab2[ lfsr1b ] ^ p_css_tab3[ lfsr1a ];
-            lfsr1b = lfsr1a >> 1;
-            lfsr1a = ((lfsr1a&1)<<8) ^ tmp;
-            out1[ i ] = p_css_tab4[ tmp ];
-        }
-
-        /* cumpute and cache some variables */
-        C[0] = nStepA >> 8;
-        C[1] = nStepA & 0xff;
-        tmp = p_disc_key[3] ^ p_css_tab1[ p_disc_key[4] ];
-        tmp2 = p_css_tab1[ p_disc_key[0] ];
-
-        /* Search through all possible B[0] */
-        for( nStepB = 0 ; nStepB < 256 ; nStepB++ )
-        {
-            /* reverse parts of the mangling cipher */
-            B[0] = nStepB;
-            k[0] = p_css_tab1[ B[0] ] ^ C[0];
-            B[4] = B[0] ^ k[0] ^ tmp2;
-            k[4] = B[4] ^ tmp;
-            nPossibleK1 = K1table[ K1TABLEWIDTH * (256 * B[0] + C[1]) ];
-
-            /* Try out all possible values for k[1] */
-            for( nTry = 0 ; nTry < nPossibleK1 ; nTry++ )
-            {
-                k[1] = K1table[ K1TABLEWIDTH * (256 * B[0] + C[1]) + nTry + 1 ];
-                B[1] = tmp5 ^ k[1];
-
-                /* reconstruct output from LFSR2 */
-                tmp3 = ( 0x100 + k[0] - out1[0] );
-                out2[0] = tmp3 & 0xff;
-                tmp3 = tmp3 & 0x100 ? 0x100 : 0xff;
-                tmp3 = ( tmp3 + k[1] - out1[1] );
-                out2[1] = tmp3 & 0xff;
-                tmp3 = ( 0x100 + k[4] - out1[4] );
-                out2[4] = tmp3 & 0xff;  /* Can be 1 off  */
-
-                /* test first possible out2[4] */
-                tmp4 = ( out2[0] << 16 ) | ( out2[1] << 8 ) | out2[4];
-                tmp4 = BigTable[ tmp4 ];
-                C[2] = tmp4 & 0xff;
-                C[3] = ( tmp4 >> 8 ) & 0xff;
-                C[4] = ( tmp4 >> 16 ) & 0xff;
-                B[3] = p_css_tab1[ B[4] ] ^ k[4] ^ C[4];
-                k[3] = p_disc_key[2] ^ p_css_tab1[ p_disc_key[3] ] ^ B[3];
-                B[2] = p_css_tab1[ B[3] ] ^ k[3] ^ C[3];
-                k[2] = p_disc_key[1] ^ p_css_tab1[ p_disc_key[2] ] ^ B[2];
-
-                if( ( B[1] ^ p_css_tab1[ B[2] ] ^ k[ 2 ]  ) == C[ 2 ] )
-                {
-                    if( ! investigate( &p_disc_key[0] , &C[0] ) )
-                    {
-                        goto end;
-                    }
-                }
-
-                /* Test second possible out2[4] */
-                out2[4] = ( out2[4] + 0xff ) & 0xff;
-                tmp4 = ( out2[0] << 16 ) | ( out2[1] << 8 ) | out2[4];
-                tmp4 = BigTable[ tmp4 ];
-                C[2] = tmp4 & 0xff;
-                C[3] = ( tmp4 >> 8 ) & 0xff;
-                C[4] = ( tmp4 >> 16 ) & 0xff;
-                B[3] = p_css_tab1[ B[4] ] ^ k[4] ^ C[4];
-                k[3] = p_disc_key[2] ^ p_css_tab1[ p_disc_key[3] ] ^ B[3];
-                B[2] = p_css_tab1[ B[3] ] ^ k[3] ^ C[3];
-                k[2] = p_disc_key[1] ^ p_css_tab1[ p_disc_key[2] ] ^ B[2];
-
-                if( ( B[1] ^ p_css_tab1[ B[2] ] ^ k[ 2 ]  ) == C[ 2 ] )
-                {
-                    if( ! investigate( &p_disc_key[0] , &C[0] ) )
-                    {
-                        goto end;
-                    }
-                }
-            }
-        }
-    }
-
-end:
-
-    memcpy( p_disc_key, &C[0], KEY_SIZE );
-
-    free( K1table );
-    free( BigTable );
-
-    return( 0 );
-}
-
-/*****************************************************************************
- * CSSTitleCrack : title key decryption by cracking
- * Function designed by Frank Stevenson
- *****************************************************************************
- * This function is called by CSSGetTitleKey to find a title key, if we've
- * chosen to crack title key instead of decrypting it with the disc key.
- *****************************************************************************/
-static int CSSTitleCrack( int i_start,
-                          unsigned char * p_crypted,
-                          unsigned char * p_decrypted,
-                          dvd_key_t * p_sector_key,
-                          dvd_key_t * p_key )
-{
-    unsigned char p_buffer[10];
-    unsigned int i_t1, i_t2, i_t3, i_t4, i_t5, i_t6;
-    unsigned int i_try;
-    unsigned int i_candidate;
-    unsigned int i, j;
-    int i_exit = -1;
-
-
-    for( i = 0 ; i < 10 ; i++ )
-    {
-        p_buffer[i] = p_css_tab1[p_crypted[i]] ^ p_decrypted[i];
-    }
-
-    for( i_try = i_start ; i_try < 0x10000 ; i_try++ )
-    {
-        i_t1 = i_try >> 8 | 0x100;
-        i_t2 = i_try & 0xff;
-        i_t3 = 0;               /* not needed */
-        i_t5 = 0;
-
-        /* iterate cipher 4 times to reconstruct LFSR2 */
-        for( i = 0 ; i < 4 ; i++ )
-        {
-            /* advance LFSR1 normaly */
-            i_t4 = p_css_tab2[i_t2] ^ p_css_tab3[i_t1];
-            i_t2 = i_t1 >> 1;
-            i_t1 = ( ( i_t1 & 1 ) << 8 ) ^ i_t4;
-            i_t4 = p_css_tab5[i_t4];
-            /* deduce i_t6 & i_t5 */
-            i_t6 = p_buffer[i];
-            if( i_t5 )
-            {
-                i_t6 = ( i_t6 + 0xff ) & 0x0ff;
-            }
-            if( i_t6 < i_t4 )
-            {
-                i_t6 += 0x100;
-            }
-            i_t6 -= i_t4;
-            i_t5 += i_t6 + i_t4;
-            i_t6 = p_css_tab4[ i_t6 ];
-            /* feed / advance i_t3 / i_t5 */
-            i_t3 = ( i_t3 << 8 ) | i_t6;
-            i_t5 >>= 8;
-        }
-
-        i_candidate = i_t3;
-
-        /* iterate 6 more times to validate candidate key */
-        for( ; i < 10 ; i++ )
-        {
-            i_t4 = p_css_tab2[i_t2] ^ p_css_tab3[i_t1];
-            i_t2 = i_t1 >> 1;
-            i_t1 = ( ( i_t1 & 1 ) << 8 ) ^ i_t4;
-            i_t4 = p_css_tab5[i_t4];
-            i_t6 = ((((((( i_t3 >> 3 ) ^ i_t3 ) >> 1 ) ^
-                                         i_t3 ) >> 8 ) ^ i_t3 ) >> 5 ) & 0xff;
-            i_t3 = ( i_t3 << 8 ) | i_t6;
-            i_t6 = p_css_tab4[i_t6];
-            i_t5 += i_t6 + i_t4;
-            if( ( i_t5 & 0xff ) != p_buffer[i] )
-            {
-                break;
-            }
-
-            i_t5 >>= 8;
-        }
-
-        if( i == 10 )
-        {
-            /* Do 4 backwards steps of iterating t3 to deduce initial state */
-            i_t3 = i_candidate;
-            for( i = 0 ; i < 4 ; i++ )
-            {
-                i_t1 = i_t3 & 0xff;
-                i_t3 = ( i_t3 >> 8 );
-                /* easy to code, and fast enough bruteforce
-                 * search for byte shifted in */
-                for( j = 0 ; j < 256 ; j++ )
-                {
-                    i_t3 = ( i_t3 & 0x1ffff) | ( j << 17 );
-                    i_t6 = ((((((( i_t3 >> 3 ) ^ i_t3 ) >> 1 ) ^
-                                   i_t3 ) >> 8 ) ^ i_t3 ) >> 5 ) & 0xff;
-                    if( i_t6 == i_t1 )
-                    {
-                        break;
-                    }
-                }
-            }
-
-            i_t4 = ( i_t3 >> 1 ) - 4;
-            for( i_t5 = 0 ; i_t5 < 8; i_t5++ )
-            {
-                if( ( ( i_t4 + i_t5 ) * 2 + 8 - ( (i_t4 + i_t5 ) & 7 ) )
-                                                                      == i_t3 )
-                {
-                    (*p_key)[0] = i_try>>8;
-                    (*p_key)[1] = i_try & 0xFF;
-                    (*p_key)[2] = ( ( i_t4 + i_t5 ) >> 0) & 0xFF;
-                    (*p_key)[3] = ( ( i_t4 + i_t5 ) >> 8) & 0xFF;
-                    (*p_key)[4] = ( ( i_t4 + i_t5 ) >> 16) & 0xFF;
-                    i_exit = i_try + 1;
-                }
-            }
-        }
-    }
-
-    if( i_exit >= 0 )
-    {
-        (*p_key)[0] ^= (*p_sector_key)[0];
-        (*p_key)[1] ^= (*p_sector_key)[1];
-        (*p_key)[2] ^= (*p_sector_key)[2];
-        (*p_key)[3] ^= (*p_sector_key)[3];
-        (*p_key)[4] ^= (*p_sector_key)[4];
-    }
-
-    return i_exit;
-}
diff --git a/extras/libdvdcss/css.h b/extras/libdvdcss/css.h
deleted file mode 100644 (file)
index 47cd411..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*****************************************************************************
- * css.h: Structures for DVD authentification and unscrambling
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: css.h,v 1.8 2002/01/23 03:15:31 stef Exp $
- *
- * Author: Stéphane Borel <stef@via.ecp.fr>
- *
- * based on:
- *  - css-auth by Derek Fawcus <derek@spider.com>
- *  - DVD CSS ioctls example program by Andrew T. Veliath <andrewtv@usa.net>
- *  - DeCSSPlus by Ethan Hawke
- *  - The Divide and conquer attack by Frank A. Stevenson <frank@funcom.com>
- *
- * 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, USA.
- *****************************************************************************/
-#define KEY_SIZE 5
-
-typedef u8 dvd_key_t[KEY_SIZE];
-
-typedef struct dvd_title_s
-{
-    int                 i_startlb;
-    dvd_key_t           p_key;
-    struct dvd_title_s *p_next;
-} dvd_title_t;
-
-typedef struct css_s
-{
-     int             i_agid;      /* Current Authenication Grant ID. */
-     dvd_key_t       p_bus_key;   /* Current session key. */
-     dvd_key_t       p_disc_key;  /* This DVD disc's key. */
-     dvd_key_t       p_unenc_key; /* Current title key before decryption. */    
-     dvd_key_t       p_title_key; /* Current title key. */    
-} css_t;
-
-/*****************************************************************************
- * Prototypes in css.c
- *****************************************************************************/
-struct css_s;
-
-int   CSSTest             ( dvdcss_handle );
-int   CSSGetDiscKey       ( dvdcss_handle );
-int   CSSGetTitleKey      ( dvdcss_handle, int );
-int   CSSDescrambleSector ( u8 * , u8 * );
-
diff --git a/extras/libdvdcss/csstables.h b/extras/libdvdcss/csstables.h
deleted file mode 100644 (file)
index 861544c..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-/*****************************************************************************
- * csstables.h: CSS Tables for DVD unscrambling
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: csstables.h,v 1.3 2001/10/13 15:34:21 stef Exp $
- *
- * Author: Stéphane Borel <stef@via.ecp.fr>
- *
- * based on:
- *  - css-auth by Derek Fawcus <derek@spider.com>
- *  - DVD CSS ioctls example program by Andrew T. Veliath <andrewtv@usa.net>
- *  - The Divide and conquer attack by Frank A. Stevenson <frank@funcom.com>
- *  - DeCSSPlus by Ethan Hawke
- *  - DecVOB
- *  see http://www.lemuria.org/DeCSS/ by Tom Vogt for more information.
- * 
- * 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, USA.
- *****************************************************************************/
-
-
-static u8 p_css_tab1[ 256 ] =
-{
-    0x33, 0x73, 0x3b, 0x26, 0x63, 0x23, 0x6b, 0x76,
-    0x3e, 0x7e, 0x36, 0x2b, 0x6e, 0x2e, 0x66, 0x7b,
-    0xd3, 0x93, 0xdb, 0x06, 0x43, 0x03, 0x4b, 0x96,
-    0xde, 0x9e, 0xd6, 0x0b, 0x4e, 0x0e, 0x46, 0x9b,
-    0x57, 0x17, 0x5f, 0x82, 0xc7, 0x87, 0xcf, 0x12,
-    0x5a, 0x1a, 0x52, 0x8f, 0xca, 0x8a, 0xc2, 0x1f,
-    0xd9, 0x99, 0xd1, 0x00, 0x49, 0x09, 0x41, 0x90,
-    0xd8, 0x98, 0xd0, 0x01, 0x48, 0x08, 0x40, 0x91,
-    0x3d, 0x7d, 0x35, 0x24, 0x6d, 0x2d, 0x65, 0x74,
-    0x3c, 0x7c, 0x34, 0x25, 0x6c, 0x2c, 0x64, 0x75,
-    0xdd, 0x9d, 0xd5, 0x04, 0x4d, 0x0d, 0x45, 0x94,
-    0xdc, 0x9c, 0xd4, 0x05, 0x4c, 0x0c, 0x44, 0x95,
-    0x59, 0x19, 0x51, 0x80, 0xc9, 0x89, 0xc1, 0x10,
-    0x58, 0x18, 0x50, 0x81, 0xc8, 0x88, 0xc0, 0x11,
-    0xd7, 0x97, 0xdf, 0x02, 0x47, 0x07, 0x4f, 0x92,
-    0xda, 0x9a, 0xd2, 0x0f, 0x4a, 0x0a, 0x42, 0x9f,
-    0x53, 0x13, 0x5b, 0x86, 0xc3, 0x83, 0xcb, 0x16,
-    0x5e, 0x1e, 0x56, 0x8b, 0xce, 0x8e, 0xc6, 0x1b,
-    0xb3, 0xf3, 0xbb, 0xa6, 0xe3, 0xa3, 0xeb, 0xf6,
-    0xbe, 0xfe, 0xb6, 0xab, 0xee, 0xae, 0xe6, 0xfb,
-    0x37, 0x77, 0x3f, 0x22, 0x67, 0x27, 0x6f, 0x72,
-    0x3a, 0x7a, 0x32, 0x2f, 0x6a, 0x2a, 0x62, 0x7f,
-    0xb9, 0xf9, 0xb1, 0xa0, 0xe9, 0xa9, 0xe1, 0xf0,
-    0xb8, 0xf8, 0xb0, 0xa1, 0xe8, 0xa8, 0xe0, 0xf1,
-    0x5d, 0x1d, 0x55, 0x84, 0xcd, 0x8d, 0xc5, 0x14,
-    0x5c, 0x1c, 0x54, 0x85, 0xcc, 0x8c, 0xc4, 0x15,
-    0xbd, 0xfd, 0xb5, 0xa4, 0xed, 0xad, 0xe5, 0xf4,
-    0xbc, 0xfc, 0xb4, 0xa5, 0xec, 0xac, 0xe4, 0xf5,
-    0x39, 0x79, 0x31, 0x20, 0x69, 0x29, 0x61, 0x70,
-    0x38, 0x78, 0x30, 0x21, 0x68, 0x28, 0x60, 0x71,
-    0xb7, 0xf7, 0xbf, 0xa2, 0xe7, 0xa7, 0xef, 0xf2,
-    0xba, 0xfa, 0xb2, 0xaf, 0xea, 0xaa, 0xe2, 0xff
-};
-
-static u8 p_css_tab2[ 256 ] =
-{
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-    0x09, 0x08, 0x0b, 0x0a, 0x0d, 0x0c, 0x0f, 0x0e,
-    0x12, 0x13, 0x10, 0x11, 0x16, 0x17, 0x14, 0x15,
-    0x1b, 0x1a, 0x19, 0x18, 0x1f, 0x1e, 0x1d, 0x1c,
-    0x24, 0x25, 0x26, 0x27, 0x20, 0x21, 0x22, 0x23,
-    0x2d, 0x2c, 0x2f, 0x2e, 0x29, 0x28, 0x2b, 0x2a,
-    0x36, 0x37, 0x34, 0x35, 0x32, 0x33, 0x30, 0x31,
-    0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38,
-    0x49, 0x48, 0x4b, 0x4a, 0x4d, 0x4c, 0x4f, 0x4e,
-    0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
-    0x5b, 0x5a, 0x59, 0x58, 0x5f, 0x5e, 0x5d, 0x5c,
-    0x52, 0x53, 0x50, 0x51, 0x56, 0x57, 0x54, 0x55,
-    0x6d, 0x6c, 0x6f, 0x6e, 0x69, 0x68, 0x6b, 0x6a,
-    0x64, 0x65, 0x66, 0x67, 0x60, 0x61, 0x62, 0x63,
-    0x7f, 0x7e, 0x7d, 0x7c, 0x7b, 0x7a, 0x79, 0x78,
-    0x76, 0x77, 0x74, 0x75, 0x72, 0x73, 0x70, 0x71,
-    0x92, 0x93, 0x90, 0x91, 0x96, 0x97, 0x94, 0x95,
-    0x9b, 0x9a, 0x99, 0x98, 0x9f, 0x9e, 0x9d, 0x9c,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-    0x89, 0x88, 0x8b, 0x8a, 0x8d, 0x8c, 0x8f, 0x8e,
-    0xb6, 0xb7, 0xb4, 0xb5, 0xb2, 0xb3, 0xb0, 0xb1,
-    0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,
-    0xa4, 0xa5, 0xa6, 0xa7, 0xa0, 0xa1, 0xa2, 0xa3,
-    0xad, 0xac, 0xaf, 0xae, 0xa9, 0xa8, 0xab, 0xaa,
-    0xdb, 0xda, 0xd9, 0xd8, 0xdf, 0xde, 0xdd, 0xdc,
-    0xd2, 0xd3, 0xd0, 0xd1, 0xd6, 0xd7, 0xd4, 0xd5,
-    0xc9, 0xc8, 0xcb, 0xca, 0xcd, 0xcc, 0xcf, 0xce,
-    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
-    0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
-    0xf6, 0xf7, 0xf4, 0xf5, 0xf2, 0xf3, 0xf0, 0xf1,
-    0xed, 0xec, 0xef, 0xee, 0xe9, 0xe8, 0xeb, 0xea,
-    0xe4, 0xe5, 0xe6, 0xe7, 0xe0, 0xe1, 0xe2, 0xe3
-};
-
-static u8 p_css_tab3[ 512 ] =
-{
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff,
-    0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff
-};
-
-static u8 p_css_tab4[ 256 ] =
-{
-    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-    0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static u8 p_css_tab5[ 256 ] =
-{
-    0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f,
-    0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f,
-    0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17,
-    0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07,
-    0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b,
-    0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b,
-    0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13,
-    0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03,
-    0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d,
-    0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d,
-    0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15,
-    0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05,
-    0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19,
-    0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09,
-    0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11,
-    0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01,
-    0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e,
-    0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e,
-    0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16,
-    0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06,
-    0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a,
-    0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a,
-    0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12,
-    0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02,
-    0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c,
-    0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c,
-    0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14,
-    0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04,
-    0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18,
-    0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08,
-    0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10,
-    0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00
-};
-
-static u8 p_crypt_tab0[ 256 ] =
-{
-    0xB7, 0xF4, 0x82, 0x57, 0xDA, 0x4D, 0xDB, 0xE2,
-    0x2F, 0x52, 0x1A, 0xA8, 0x68, 0x5A, 0x8A, 0xFF,
-    0xFB, 0x0E, 0x6D, 0x35, 0xF7, 0x5C, 0x76, 0x12,
-    0xCE, 0x25, 0x79, 0x29, 0x39, 0x62, 0x08, 0x24,
-    0xA5, 0x85, 0x7B, 0x56, 0x01, 0x23, 0x68, 0xCF,
-    0x0A, 0xE2, 0x5A, 0xED, 0x3D, 0x59, 0xB0, 0xA9,
-    0xB0, 0x2C, 0xF2, 0xB8, 0xEF, 0x32, 0xA9, 0x40,
-    0x80, 0x71, 0xAF, 0x1E, 0xDE, 0x8F, 0x58, 0x88,
-    0xB8, 0x3A, 0xD0, 0xFC, 0xC4, 0x1E, 0xB5, 0xA0,
-    0xBB, 0x3B, 0x0F, 0x01, 0x7E, 0x1F, 0x9F, 0xD9,
-    0xAA, 0xB8, 0x3D, 0x9D, 0x74, 0x1E, 0x25, 0xDB,
-    0x37, 0x56, 0x8F, 0x16, 0xBA, 0x49, 0x2B, 0xAC,
-    0xD0, 0xBD, 0x95, 0x20, 0xBE, 0x7A, 0x28, 0xD0,
-    0x51, 0x64, 0x63, 0x1C, 0x7F, 0x66, 0x10, 0xBB,
-    0xC4, 0x56, 0x1A, 0x04, 0x6E, 0x0A, 0xEC, 0x9C,
-    0xD6, 0xE8, 0x9A, 0x7A, 0xCF, 0x8C, 0xDB, 0xB1,
-    0xEF, 0x71, 0xDE, 0x31, 0xFF, 0x54, 0x3E, 0x5E,
-    0x07, 0x69, 0x96, 0xB0, 0xCF, 0xDD, 0x9E, 0x47,
-    0xC7, 0x96, 0x8F, 0xE4, 0x2B, 0x59, 0xC6, 0xEE,
-    0xB9, 0x86, 0x9A, 0x64, 0x84, 0x72, 0xE2, 0x5B,
-    0xA2, 0x96, 0x58, 0x99, 0x50, 0x03, 0xF5, 0x38,
-    0x4D, 0x02, 0x7D, 0xE7, 0x7D, 0x75, 0xA7, 0xB8,
-    0x67, 0x87, 0x84, 0x3F, 0x1D, 0x11, 0xE5, 0xFC,
-    0x1E, 0xD3, 0x83, 0x16, 0xA5, 0x29, 0xF6, 0xC7,
-    0x15, 0x61, 0x29, 0x1A, 0x43, 0x4F, 0x9B, 0xAF,
-    0xC5, 0x87, 0x34, 0x6C, 0x0F, 0x3B, 0xA8, 0x1D,
-    0x45, 0x58, 0x25, 0xDC, 0xA8, 0xA3, 0x3B, 0xD1,
-    0x79, 0x1B, 0x48, 0xF2, 0xE9, 0x93, 0x1F, 0xFC,
-    0xDB, 0x2A, 0x90, 0xA9, 0x8A, 0x3D, 0x39, 0x18,
-    0xA3, 0x8E, 0x58, 0x6C, 0xE0, 0x12, 0xBB, 0x25,
-    0xCD, 0x71, 0x22, 0xA2, 0x64, 0xC6, 0xE7, 0xFB,
-    0xAD, 0x94, 0x77, 0x04, 0x9A, 0x39, 0xCF, 0x7C
-};
-
-static u8 p_crypt_tab1[ 256 ] =
-{
-    0x8C, 0x47, 0xB0, 0xE1, 0xEB, 0xFC, 0xEB, 0x56,
-    0x10, 0xE5, 0x2C, 0x1A, 0x5D, 0xEF, 0xBE, 0x4F,
-    0x08, 0x75, 0x97, 0x4B, 0x0E, 0x25, 0x8E, 0x6E,
-    0x39, 0x5A, 0x87, 0x53, 0xC4, 0x1F, 0xF4, 0x5C,
-    0x4E, 0xE6, 0x99, 0x30, 0xE0, 0x42, 0x88, 0xAB,
-    0xE5, 0x85, 0xBC, 0x8F, 0xD8, 0x3C, 0x54, 0xC9,
-    0x53, 0x47, 0x18, 0xD6, 0x06, 0x5B, 0x41, 0x2C,
-    0x67, 0x1E, 0x41, 0x74, 0x33, 0xE2, 0xB4, 0xE0,
-    0x23, 0x29, 0x42, 0xEA, 0x55, 0x0F, 0x25, 0xB4,
-    0x24, 0x2C, 0x99, 0x13, 0xEB, 0x0A, 0x0B, 0xC9,
-    0xF9, 0x63, 0x67, 0x43, 0x2D, 0xC7, 0x7D, 0x07,
-    0x60, 0x89, 0xD1, 0xCC, 0xE7, 0x94, 0x77, 0x74,
-    0x9B, 0x7E, 0xD7, 0xE6, 0xFF, 0xBB, 0x68, 0x14,
-    0x1E, 0xA3, 0x25, 0xDE, 0x3A, 0xA3, 0x54, 0x7B,
-    0x87, 0x9D, 0x50, 0xCA, 0x27, 0xC3, 0xA4, 0x50,
-    0x91, 0x27, 0xD4, 0xB0, 0x82, 0x41, 0x97, 0x79,
-    0x94, 0x82, 0xAC, 0xC7, 0x8E, 0xA5, 0x4E, 0xAA,
-    0x78, 0x9E, 0xE0, 0x42, 0xBA, 0x28, 0xEA, 0xB7,
-    0x74, 0xAD, 0x35, 0xDA, 0x92, 0x60, 0x7E, 0xD2,
-    0x0E, 0xB9, 0x24, 0x5E, 0x39, 0x4F, 0x5E, 0x63,
-    0x09, 0xB5, 0xFA, 0xBF, 0xF1, 0x22, 0x55, 0x1C,
-    0xE2, 0x25, 0xDB, 0xC5, 0xD8, 0x50, 0x03, 0x98,
-    0xC4, 0xAC, 0x2E, 0x11, 0xB4, 0x38, 0x4D, 0xD0,
-    0xB9, 0xFC, 0x2D, 0x3C, 0x08, 0x04, 0x5A, 0xEF,
-    0xCE, 0x32, 0xFB, 0x4C, 0x92, 0x1E, 0x4B, 0xFB,
-    0x1A, 0xD0, 0xE2, 0x3E, 0xDA, 0x6E, 0x7C, 0x4D,
-    0x56, 0xC3, 0x3F, 0x42, 0xB1, 0x3A, 0x23, 0x4D,
-    0x6E, 0x84, 0x56, 0x68, 0xF4, 0x0E, 0x03, 0x64,
-    0xD0, 0xA9, 0x92, 0x2F, 0x8B, 0xBC, 0x39, 0x9C,
-    0xAC, 0x09, 0x5E, 0xEE, 0xE5, 0x97, 0xBF, 0xA5,
-    0xCE, 0xFA, 0x28, 0x2C, 0x6D, 0x4F, 0xEF, 0x77,
-    0xAA, 0x1B, 0x79, 0x8E, 0x97, 0xB4, 0xC3, 0xF4
-};
-
-static u8 p_crypt_tab2[ 256 ] =
-{
-    0xB7, 0x75, 0x81, 0xD5, 0xDC, 0xCA, 0xDE, 0x66,
-    0x23, 0xDF, 0x15, 0x26, 0x62, 0xD1, 0x83, 0x77,
-    0xE3, 0x97, 0x76, 0xAF, 0xE9, 0xC3, 0x6B, 0x8E,
-    0xDA, 0xB0, 0x6E, 0xBF, 0x2B, 0xF1, 0x19, 0xB4,
-    0x95, 0x34, 0x48, 0xE4, 0x37, 0x94, 0x5D, 0x7B,
-    0x36, 0x5F, 0x65, 0x53, 0x07, 0xE2, 0x89, 0x11,
-    0x98, 0x85, 0xD9, 0x12, 0xC1, 0x9D, 0x84, 0xEC,
-    0xA4, 0xD4, 0x88, 0xB8, 0xFC, 0x2C, 0x79, 0x28,
-    0xD8, 0xDB, 0xB3, 0x1E, 0xA2, 0xF9, 0xD0, 0x44,
-    0xD7, 0xD6, 0x60, 0xEF, 0x14, 0xF4, 0xF6, 0x31,
-    0xD2, 0x41, 0x46, 0x67, 0x0A, 0xE1, 0x58, 0x27,
-    0x43, 0xA3, 0xF8, 0xE0, 0xC8, 0xBA, 0x5A, 0x5C,
-    0x80, 0x6C, 0xC6, 0xF2, 0xE8, 0xAD, 0x7D, 0x04,
-    0x0D, 0xB9, 0x3C, 0xC2, 0x25, 0xBD, 0x49, 0x63,
-    0x8C, 0x9F, 0x51, 0xCE, 0x20, 0xC5, 0xA1, 0x50,
-    0x92, 0x2D, 0xDD, 0xBC, 0x8D, 0x4F, 0x9A, 0x71,
-    0x2F, 0x30, 0x1D, 0x73, 0x39, 0x13, 0xFB, 0x1A,
-    0xCB, 0x24, 0x59, 0xFE, 0x05, 0x96, 0x57, 0x0F,
-    0x1F, 0xCF, 0x54, 0xBE, 0xF5, 0x06, 0x1B, 0xB2,
-    0x6D, 0xD3, 0x4D, 0x32, 0x56, 0x21, 0x33, 0x0B,
-    0x52, 0xE7, 0xAB, 0xEB, 0xA6, 0x74, 0x00, 0x4C,
-    0xB1, 0x7F, 0x82, 0x99, 0x87, 0x0E, 0x5E, 0xC0,
-    0x8F, 0xEE, 0x6F, 0x55, 0xF3, 0x7E, 0x08, 0x90,
-    0xFA, 0xB6, 0x64, 0x70, 0x47, 0x4A, 0x17, 0xA7,
-    0xB5, 0x40, 0x8A, 0x38, 0xE5, 0x68, 0x3E, 0x8B,
-    0x69, 0xAA, 0x9B, 0x42, 0xA5, 0x10, 0x01, 0x35,
-    0xFD, 0x61, 0x9E, 0xE6, 0x16, 0x9C, 0x86, 0xED,
-    0xCD, 0x2E, 0xFF, 0xC4, 0x5B, 0xA0, 0xAE, 0xCC,
-    0x4B, 0x3B, 0x03, 0xBB, 0x1C, 0x2A, 0xAC, 0x0C,
-    0x3F, 0x93, 0xC7, 0x72, 0x7A, 0x09, 0x22, 0x3D,
-    0x45, 0x78, 0xA9, 0xA8, 0xEA, 0xC9, 0x6A, 0xF7,
-    0x29, 0x91, 0xF0, 0x02, 0x18, 0x3A, 0x4E, 0x7C 
-};
-
-static u8 p_crypt_tab3[ 288 ] =
-{
-    0x73, 0x51, 0x95, 0xE1, 0x12, 0xE4, 0xC0, 0x58,
-    0xEE, 0xF2, 0x08, 0x1B, 0xA9, 0xFA, 0x98, 0x4C,
-    0xA7, 0x33, 0xE2, 0x1B, 0xA7, 0x6D, 0xF5, 0x30,
-    0x97, 0x1D, 0xF3, 0x02, 0x60, 0x5A, 0x82, 0x0F,
-    0x91, 0xD0, 0x9C, 0x10, 0x39, 0x7A, 0x83, 0x85,
-    0x3B, 0xB2, 0xB8, 0xAE, 0x0C, 0x09, 0x52, 0xEA,
-    0x1C, 0xE1, 0x8D, 0x66, 0x4F, 0xF3, 0xDA, 0x92,
-    0x29, 0xB9, 0xD5, 0xC5, 0x77, 0x47, 0x22, 0x53,
-    0x14, 0xF7, 0xAF, 0x22, 0x64, 0xDF, 0xC6, 0x72,
-    0x12, 0xF3, 0x75, 0xDA, 0xD7, 0xD7, 0xE5, 0x02,
-    0x9E, 0xED, 0xDA, 0xDB, 0x4C, 0x47, 0xCE, 0x91,
-    0x06, 0x06, 0x6D, 0x55, 0x8B, 0x19, 0xC9, 0xEF,
-    0x8C, 0x80, 0x1A, 0x0E, 0xEE, 0x4B, 0xAB, 0xF2,
-    0x08, 0x5C, 0xE9, 0x37, 0x26, 0x5E, 0x9A, 0x90,
-    0x00, 0xF3, 0x0D, 0xB2, 0xA6, 0xA3, 0xF7, 0x26,
-    0x17, 0x48, 0x88, 0xC9, 0x0E, 0x2C, 0xC9, 0x02,
-    0xE7, 0x18, 0x05, 0x4B, 0xF3, 0x39, 0xE1, 0x20,
-    0x02, 0x0D, 0x40, 0xC7, 0xCA, 0xB9, 0x48, 0x30,
-    0x57, 0x67, 0xCC, 0x06, 0xBF, 0xAC, 0x81, 0x08,
-    0x24, 0x7A, 0xD4, 0x8B, 0x19, 0x8E, 0xAC, 0xB4,
-    0x5A, 0x0F, 0x73, 0x13, 0xAC, 0x9E, 0xDA, 0xB6,
-    0xB8, 0x96, 0x5B, 0x60, 0x88, 0xE1, 0x81, 0x3F,
-    0x07, 0x86, 0x37, 0x2D, 0x79, 0x14, 0x52, 0xEA,
-    0x73, 0xDF, 0x3D, 0x09, 0xC8, 0x25, 0x48, 0xD8,
-    0x75, 0x60, 0x9A, 0x08, 0x27, 0x4A, 0x2C, 0xB9,
-    0xA8, 0x8B, 0x8A, 0x73, 0x62, 0x37, 0x16, 0x02,
-    0xBD, 0xC1, 0x0E, 0x56, 0x54, 0x3E, 0x14, 0x5F,
-    0x8C, 0x8F, 0x6E, 0x75, 0x1C, 0x07, 0x39, 0x7B,
-    0x4B, 0xDB, 0xD3, 0x4B, 0x1E, 0xC8, 0x7E, 0xFE,
-    0x3E, 0x72, 0x16, 0x83, 0x7D, 0xEE, 0xF5, 0xCA,
-    0xC5, 0x18, 0xF9, 0xD8, 0x68, 0xAB, 0x38, 0x85,
-    0xA8, 0xF0, 0xA1, 0x73, 0x9F, 0x5D, 0x19, 0x0B,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x33, 0x72, 0x39, 0x25, 0x67, 0x26, 0x6D, 0x71,
-    0x36, 0x77, 0x3C, 0x20, 0x62, 0x23, 0x68, 0x74,
-    0xC3, 0x82, 0xC9, 0x15, 0x57, 0x16, 0x5D, 0x81
-};
-
diff --git a/extras/libdvdcss/ioctl.c b/extras/libdvdcss/ioctl.c
deleted file mode 100644 (file)
index f5dddc3..0000000
+++ /dev/null
@@ -1,1670 +0,0 @@
-/*****************************************************************************
- * ioctl.c: DVD ioctl replacement function
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: ioctl.c,v 1.21 2002/04/01 21:54:26 gbazin Exp $
- *
- * Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
- *          Samuel Hocevar <sam@zoy.org>
- *          Jon Lech Johansen <jon-vl@nanocrew.net>
- *          Håkan Hjort <d95hjort@dtek.chalmers.se>
- *          Eugenio Jarosiewicz <ej0@cise.ufl.edu>
- *          David Siebörger <drs-videolan@rucus.ru.ac.za>
- *
- * 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, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdio.h>
-
-#include <string.h>                                    /* memcpy(), memset() */
-#include <sys/types.h>
-
-#include <videolan/vlc.h>
-
-#if defined( WIN32 )
-#   include <windows.h>
-#   include <winioctl.h>
-#else
-#   include <netinet/in.h>
-#   include <sys/ioctl.h>
-#endif
-
-#ifdef DVD_STRUCT_IN_SYS_CDIO_H
-#   include <sys/cdio.h>
-#endif
-#ifdef DVD_STRUCT_IN_SYS_DVDIO_H
-#   include <sys/dvdio.h>
-#endif
-#ifdef DVD_STRUCT_IN_LINUX_CDROM_H
-#   include <linux/cdrom.h>
-#endif
-#ifdef DVD_STRUCT_IN_DVD_H
-#   include <dvd.h>
-#endif
-#ifdef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H
-#   include <BSDI_dvdioctl/dvd.h>
-#endif
-#ifdef SYS_BEOS
-#   include <malloc.h>
-#   include <scsi.h>
-#endif
-#ifdef HPUX_SCTL_IO
-#   include <sys/scsi.h>
-#endif
-#ifdef SOLARIS_USCSI
-#   include <unistd.h>
-#   include <stropts.h>
-#   include <sys/scsi/scsi_types.h>
-#   include <sys/scsi/impl/uscsi.h>
-#endif
-
-#ifdef SYS_DARWIN
-#   include <IOKit/storage/IODVDMediaBSDClient.h>
-/* #   include "DVDioctl/DVDioctl.h" */
-#endif
-
-#include "ioctl.h"
-
-
-/*****************************************************************************
- * Local prototypes, BeOS specific
- *****************************************************************************/
-#if defined( SYS_BEOS )
-static void BeInitRDC ( raw_device_command *, int );
-#endif
-
-/*****************************************************************************
- * Local prototypes, HP-UX specific
- *****************************************************************************/
-#if defined( HPUX_SCTL_IO )
-static void HPUXInitSCTL ( struct sctl_io *sctl_io, int i_type );
-#endif
-
-/*****************************************************************************
- * Local prototypes, Solaris specific
- *****************************************************************************/
-#if defined( SOLARIS_USCSI )
-static void SolarisInitUSCSI( struct uscsi_cmd *p_sc, int i_type );
-#endif
-
-/*****************************************************************************
- * Local prototypes, win32 (aspi) specific
- *****************************************************************************/
-#if defined( WIN32 )
-static void WinInitSSC ( struct SRB_ExecSCSICmd *, int );
-static int  WinSendSSC ( int, struct SRB_ExecSCSICmd * );
-#endif
-
-/*****************************************************************************
- * ioctl_ReadCopyright: check whether the disc is encrypted or not
- *****************************************************************************/
-int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_struct dvd;
-
-    memset( &dvd, 0, sizeof( dvd ) );
-    dvd.type = DVD_STRUCT_COPYRIGHT;
-    dvd.copyright.layer_num = i_layer;
-
-    i_ret = ioctl( i_fd, DVD_READ_STRUCT, &dvd );
-
-    *pi_copyright = dvd.copyright.cpst;
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_struct dvd;
-
-    memset( &dvd, 0, sizeof( dvd ) );
-    dvd.format = DVD_STRUCT_COPYRIGHT;
-    dvd.layer_num = i_layer;
-
-    i_ret = ioctl( i_fd, DVDIOCREADSTRUCTURE, &dvd );
-
-    *pi_copyright = dvd.cpst;
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_READ_DVD_STRUCTURE, 8 );
-
-    rdc.command[ 6 ] = i_layer;
-    rdc.command[ 7 ] = DVD_STRUCT_COPYRIGHT;
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    *pi_copyright = p_buffer[ 4 ];
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_READ_DVD_STRUCTURE, 8 );
-
-    sctl_io.cdb[ 6 ] = i_layer;
-    sctl_io.cdb[ 7 ] = DVD_STRUCT_COPYRIGHT;
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    *pi_copyright = p_buffer[ 4 ];
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_READ_DVD_STRUCTURE, 8 );
-    
-    rs_cdb.cdb_opaque[ 6 ] = i_layer;
-    rs_cdb.cdb_opaque[ 7 ] = DVD_STRUCT_COPYRIGHT;
-
-    i_ret = ioctl(i_fd, USCSICMD, &sc);
-
-    if( i_ret < 0 || sc.uscsi_status ) {
-        i_ret = -1;
-    }
-    
-    *pi_copyright = p_buffer[ 4 ];
-    /* s->copyright.rmi = p_buffer[ 5 ]; */
-
-#elif defined( SYS_DARWIN )
-    dk_dvd_read_structure_t dvd;
-    DVDCopyrightInfo dvdcpi;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdcpi, 0, sizeof(dvdcpi));
-
-    dvd.buffer = &dvdcpi;
-    dvd.bufferLength = sizeof(dvdcpi);
-    dvd.format = kDVDStructureFormatCopyrightInfo;
-    dvd.layer = i_layer;
-
-    /* dvdcpi.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    /* dvdcpi.dataLength[1] = 0x06; */
-    
-    i_ret = ioctl( i_fd, DKIOCDVDREADSTRUCTURE, &dvd );
-
-    *pi_copyright = dvdcpi.copyrightProtectionSystemType;
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 p_buffer[ 8 ];
-        SCSI_PASS_THROUGH_DIRECT sptd;
-
-        memset( &sptd, 0, sizeof( sptd ) );
-        memset( &p_buffer, 0, sizeof( p_buffer ) );
-   
-        /*  When using IOCTL_DVD_READ_STRUCTURE and 
-            DVD_COPYRIGHT_DESCRIPTOR, CopyrightProtectionType
-            is always 6. So we send a raw scsi command instead. */
-
-        sptd.Length             = sizeof( SCSI_PASS_THROUGH_DIRECT );
-        sptd.CdbLength          = 12;
-        sptd.DataIn             = SCSI_IOCTL_DATA_IN;
-        sptd.DataTransferLength = 8;
-        sptd.TimeOutValue       = 2;
-        sptd.DataBuffer         = p_buffer;
-        sptd.Cdb[ 0 ]           = GPCMD_READ_DVD_STRUCTURE;
-        sptd.Cdb[ 6 ]           = i_layer;
-        sptd.Cdb[ 7 ]           = DVD_STRUCT_COPYRIGHT;
-        sptd.Cdb[ 8 ]           = (8 >> 8) & 0xff;
-        sptd.Cdb[ 9 ]           =  8       & 0xff;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd,
-                             IOCTL_SCSI_PASS_THROUGH_DIRECT,
-                             &sptd, sizeof( SCSI_PASS_THROUGH_DIRECT ),
-                             &sptd, sizeof( SCSI_PASS_THROUGH_DIRECT ),
-                             &tmp, NULL ) ? 0 : -1;
-
-        *pi_copyright = p_buffer[ 4 ];
-    }
-    else
-    {
-        INIT_SSC( GPCMD_READ_DVD_STRUCTURE, 8 );
-
-        ssc.CDBByte[ 6 ] = i_layer;
-        ssc.CDBByte[ 7 ] = DVD_STRUCT_COPYRIGHT;
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        *pi_copyright = p_buffer[ 4 ];
-    }
-
-#elif defined( __QNXNTO__ )
-    /*
-        QNX RTOS currently doesn't have a CAM
-        interface (they're working on it though).
-        Assume DVD is not encrypted.
-    */
-
-    *pi_copyright = 0;
-    i_ret = 0;
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_ReadDiscKey: get the disc key
- *****************************************************************************/
-int ioctl_ReadDiscKey( int i_fd, int *pi_agid, u8 *p_key )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_struct dvd;
-
-    memset( &dvd, 0, sizeof( dvd ) );
-    dvd.type = DVD_STRUCT_DISCKEY;
-    dvd.disckey.agid = *pi_agid;
-    memset( dvd.disckey.value, 0, DVD_DISCKEY_SIZE );
-
-    i_ret = ioctl( i_fd, DVD_READ_STRUCT, &dvd );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    memcpy( p_key, dvd.disckey.value, DVD_DISCKEY_SIZE );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_struct dvd;
-
-    memset( &dvd, 0, sizeof( dvd ) );
-    dvd.format = DVD_STRUCT_DISCKEY;
-    dvd.agid = *pi_agid;
-    memset( dvd.data, 0, DVD_DISCKEY_SIZE );
-
-    i_ret = ioctl( i_fd, DVDIOCREADSTRUCTURE, &dvd );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    memcpy( p_key, dvd.data, DVD_DISCKEY_SIZE );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );
-
-    rdc.command[ 7 ]  = DVD_STRUCT_DISCKEY;
-    rdc.command[ 10 ] = *pi_agid << 6;
-    
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    memcpy( p_key, p_buffer + 4, DVD_DISCKEY_SIZE );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );
-
-    sctl_io.cdb[ 7 ]  = DVD_STRUCT_DISCKEY;
-    sctl_io.cdb[ 10 ] = *pi_agid << 6;
-    
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    memcpy( p_key, p_buffer + 4, DVD_DISCKEY_SIZE );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );
-    
-    rs_cdb.cdb_opaque[ 7 ] = DVD_STRUCT_DISCKEY;
-    rs_cdb.cdb_opaque[ 10 ] = *pi_agid << 6;
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-        return i_ret;
-    }
-
-    memcpy( p_key, p_buffer + 4, DVD_DISCKEY_SIZE );
-
-#elif defined( SYS_DARWIN )
-    dk_dvd_read_structure_t dvd;
-    DVDDiscKeyInfo dvddki;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvddki, 0, sizeof(dvddki));
-
-    dvd.buffer = &dvddki;
-    dvd.bufferLength = sizeof(dvddki);
-    dvd.format = kDVDStructureFormatDiscKeyInfo;
-    dvd.grantID = *pi_agid;
-
-    /* 2048+2 ; maybe we should do bit shifts to value of (sizeof(dvddki)-2) */
-    dvddki.dataLength[ 0 ] = 0x04;
-    dvddki.dataLength[ 1 ] = 0x02;
-
-    i_ret = ioctl( i_fd, DKIOCDVDREADSTRUCTURE, &dvd );
-
-    memcpy( p_key, dvddki.discKeyStructures, DVD_DISCKEY_SIZE );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_DISK_KEY_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_DISK_KEY_LENGTH;
-        key->SessionId  = *pi_agid;
-        key->KeyType    = DvdDiskKey;
-        key->KeyFlags   = 0;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-
-        if( i_ret < 0 )
-        {   
-            return i_ret;
-        }
-
-        memcpy( p_key, key->KeyData, DVD_DISCKEY_SIZE );
-    }
-    else
-    {
-        INIT_SSC( GPCMD_READ_DVD_STRUCTURE, DVD_DISCKEY_SIZE + 4 );
-
-        ssc.CDBByte[ 7 ]  = DVD_STRUCT_DISCKEY;
-        ssc.CDBByte[ 10 ] = *pi_agid << 6;
-    
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        if( i_ret < 0 )
-        {
-            return i_ret;
-        }
-
-        memcpy( p_key, p_buffer + 4, DVD_DISCKEY_SIZE );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_ReadTitleKey: get the title key
- *****************************************************************************/
-int ioctl_ReadTitleKey( int i_fd, int *pi_agid, int i_pos, u8 *p_key )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_LU_SEND_TITLE_KEY;
-    auth_info.lstk.agid = *pi_agid;
-    auth_info.lstk.lba = i_pos;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-    memcpy( p_key, auth_info.lstk.title_key, DVD_KEY_SIZE );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_REPORT_TITLE_KEY;
-    auth_info.agid = *pi_agid;
-    auth_info.lba = i_pos;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-    memcpy( p_key, auth_info.keychal, DVD_KEY_SIZE );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 12 );
-
-    rdc.command[ 2 ] = ( i_pos >> 24 ) & 0xff;
-    rdc.command[ 3 ] = ( i_pos >> 16 ) & 0xff;
-    rdc.command[ 4 ] = ( i_pos >>  8 ) & 0xff;
-    rdc.command[ 5 ] = ( i_pos       ) & 0xff;
-    rdc.command[ 10 ] = DVD_REPORT_TITLE_KEY | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    memcpy( p_key, p_buffer + 5, DVD_KEY_SIZE );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_REPORT_KEY, 12 );
-
-    sctl_io.cdb[ 2 ] = ( i_pos >> 24 ) & 0xff;
-    sctl_io.cdb[ 3 ] = ( i_pos >> 16 ) & 0xff;
-    sctl_io.cdb[ 4 ] = ( i_pos >>  8 ) & 0xff;
-    sctl_io.cdb[ 5 ] = ( i_pos       ) & 0xff;
-    sctl_io.cdb[ 10 ] = DVD_REPORT_TITLE_KEY | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    memcpy( p_key, p_buffer + 5, DVD_KEY_SIZE );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 12 );
-    
-    rs_cdb.cdb_opaque[ 2 ] = ( i_pos >> 24 ) & 0xff;
-    rs_cdb.cdb_opaque[ 3 ] = ( i_pos >> 16 ) & 0xff;
-    rs_cdb.cdb_opaque[ 4 ] = ( i_pos >>  8 ) & 0xff;
-    rs_cdb.cdb_opaque[ 5 ] = ( i_pos       ) & 0xff;
-    rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_TITLE_KEY | (*pi_agid << 6);
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-
-    /* Do we want to return the cp_sec flag perhaps? */
-    /* a->lstk.cpm    = (buf[ 4 ] >> 7) & 1; */
-    /* a->lstk.cp_sec = (buf[ 4 ] >> 6) & 1; */
-    /* a->lstk.cgms   = (buf[ 4 ] >> 4) & 3; */
-    memcpy( p_key, p_buffer + 5, DVD_KEY_SIZE ); 
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_report_key_t dvd;
-    DVDTitleKeyInfo dvdtki;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdtki, 0, sizeof(dvdtki));
-
-    dvd.buffer = &dvdtki;
-    dvd.bufferLength = sizeof(dvdtki);
-    dvd.format = kDVDKeyFormatTitleKey;
-    dvd.grantID = *pi_agid;
-    dvd.keyClass = kDVDKeyClassCSS_CPPM_CPRM; /* or this - this is memset 0x00 anyways */
-
-    /* dvdtki.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    dvdtki.dataLength[ 1 ] = 0x0a;
-    
-    /* What are DVDTitleKeyInfo.{CP_MOD,CGMS,CP_SEC,CPM} and do they need to be set? */
-#warning "Correct title key reading for MacOSX / Darwin!"
-    /* hh: No that should be part of the result I belive.
-     * You do need to set the sector/lba/position somehow though! */
-
-    i_ret = ioctl( i_fd, DKIOCDVDREPORTKEY, &dvd );
-
-    memcpy( p_key, dvdtki.titleKeyValue, DVD_KEY_SIZE );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_BUS_KEY_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_BUS_KEY_LENGTH;
-        key->SessionId  = *pi_agid;
-        key->KeyType    = DvdTitleKey;
-        key->KeyFlags   = 0;
-        key->Parameters.TitleOffset.QuadPart = i_pos;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-
-        memcpy( p_key, key->KeyData, DVD_KEY_SIZE );
-    }
-    else
-    {
-        INIT_SSC( GPCMD_REPORT_KEY, 12 );
-
-        ssc.CDBByte[ 2 ] = ( i_pos >> 24 ) & 0xff;
-        ssc.CDBByte[ 3 ] = ( i_pos >> 16 ) & 0xff;
-        ssc.CDBByte[ 4 ] = ( i_pos >>  8 ) & 0xff;
-        ssc.CDBByte[ 5 ] = ( i_pos       ) & 0xff;
-        ssc.CDBByte[ 10 ] = DVD_REPORT_TITLE_KEY | (*pi_agid << 6);
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        memcpy( p_key, p_buffer + 5, DVD_KEY_SIZE );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-
-    return i_ret;
-}
-
-
-/*****************************************************************************
- * ioctl_ReportAgid: get AGID from the drive
- *****************************************************************************/
-int ioctl_ReportAgid( int i_fd, int *pi_agid )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_LU_SEND_AGID;
-    auth_info.lsa.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-    *pi_agid = auth_info.lsa.agid;
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_REPORT_AGID;
-    auth_info.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-    *pi_agid = auth_info.agid;
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 8 );
-
-    rdc.command[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    *pi_agid = p_buffer[ 7 ] >> 6;
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_REPORT_KEY, 8 );
-
-    sctl_io.cdb[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    *pi_agid = p_buffer[ 7 ] >> 6;
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 8 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-
-    *pi_agid = p_buffer[ 7 ] >> 6;
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_report_key_t dvd;
-    DVDAuthenticationGrantIDInfo dvdagid;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdagid, 0, sizeof(dvdagid));
-
-    dvd.buffer = &dvdagid;
-    dvd.bufferLength = sizeof(dvdagid);
-    dvd.format = kDVDKeyFormatAGID_CSS;
-    dvd.grantID = *pi_agid;
-    dvdagid.grantID = *pi_agid; /* do we need this? */
-    dvd.keyClass = kDVDKeyClassCSS_CPPM_CPRM; /* or this - this is memset 0x00 anyways */
-
-    /* dvdagid.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    /* dvdagid.dataLength[1] = 0x06; */
-
-    i_ret = ioctl( i_fd, DKIOCDVDREPORTKEY, &dvd );
-
-    *pi_agid = dvdagid.grantID;
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        ULONG id;
-        DWORD tmp;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_START_SESSION, 
-                        &tmp, 4, &id, sizeof( id ), &tmp, NULL ) ? 0 : -1;
-
-        *pi_agid = id;
-    }
-    else
-    {
-        INIT_SSC( GPCMD_REPORT_KEY, 8 );
-
-        ssc.CDBByte[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6);
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        *pi_agid = p_buffer[ 7 ] >> 6;
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_ReportChallenge: get challenge from the drive
- *****************************************************************************/
-int ioctl_ReportChallenge( int i_fd, int *pi_agid, u8 *p_challenge )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_LU_SEND_CHALLENGE;
-    auth_info.lsc.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-    memcpy( p_challenge, auth_info.lsc.chal, DVD_CHALLENGE_SIZE );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_REPORT_CHALLENGE;
-    auth_info.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-    memcpy( p_challenge, auth_info.keychal, DVD_CHALLENGE_SIZE );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 16 );
-
-    rdc.command[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    memcpy( p_challenge, p_buffer + 4, DVD_CHALLENGE_SIZE );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_REPORT_KEY, 16 );
-
-    sctl_io.cdb[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    memcpy( p_challenge, p_buffer + 4, DVD_CHALLENGE_SIZE );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 16 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-
-    memcpy( p_challenge, p_buffer + 4, DVD_CHALLENGE_SIZE );
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_report_key_t dvd;
-    DVDChallengeKeyInfo dvdcki;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdcki, 0, sizeof(dvdcki));
-
-    dvd.buffer = &dvdcki;
-    dvd.bufferLength = sizeof(dvdcki);
-    dvd.format = kDVDKeyFormatChallengeKey;
-    dvd.grantID = *pi_agid;
-
-    /* dvdcki.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    dvdcki.dataLength[ 1 ] = 0x0e;
-
-    i_ret = ioctl( i_fd, DKIOCDVDREPORTKEY, &dvd );
-
-    memcpy( p_challenge, dvdcki.challengeKeyValue, DVD_CHALLENGE_SIZE );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_CHALLENGE_KEY_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_CHALLENGE_KEY_LENGTH;
-        key->SessionId  = *pi_agid;
-        key->KeyType    = DvdChallengeKey;
-        key->KeyFlags   = 0;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-
-        if( i_ret < 0 )
-        {
-            return i_ret;
-        }
-
-        memcpy( p_challenge, key->KeyData, DVD_CHALLENGE_SIZE );
-    }
-    else
-    {
-        INIT_SSC( GPCMD_REPORT_KEY, 16 );
-
-        ssc.CDBByte[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6);
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        memcpy( p_challenge, p_buffer + 4, DVD_CHALLENGE_SIZE );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_ReportASF: get ASF from the drive
- *****************************************************************************/
-int ioctl_ReportASF( int i_fd, int *pi_remove_me, int *pi_asf )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_LU_SEND_ASF;
-    auth_info.lsasf.asf = *pi_asf;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-    *pi_asf = auth_info.lsasf.asf;
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_REPORT_ASF;
-    auth_info.asf = *pi_asf;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-    *pi_asf = auth_info.asf;
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 8 );
-
-    rdc.command[ 10 ] = DVD_REPORT_ASF;
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    *pi_asf = p_buffer[ 7 ] & 1;
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_REPORT_KEY, 8 );
-
-    sctl_io.cdb[ 10 ] = DVD_REPORT_ASF;
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    *pi_asf = p_buffer[ 7 ] & 1;
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 8 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_ASF;
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-
-    *pi_asf = p_buffer[ 7 ] & 1;
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_report_key_t dvd;
-    DVDAuthenticationSuccessFlagInfo dvdasfi;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdasfi, 0, sizeof(dvdasfi));
-
-    dvd.buffer = &dvdasfi;
-    dvd.bufferLength = sizeof(dvdasfi);
-    dvd.format = kDVDKeyFormatASF;
-    dvdasfi.successFlag = *pi_asf;
-
-    /* dvdasfi.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    dvdasfi.dataLength[ 1 ] = 0x06;
-    
-    i_ret = ioctl( i_fd, DKIOCDVDREPORTKEY, &dvd );
-
-    *pi_asf = dvdasfi.successFlag;
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_ASF_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_ASF_LENGTH;
-        key->KeyType    = DvdAsf;
-        key->KeyFlags   = 0;
-
-        ((PDVD_ASF)key->KeyData)->SuccessFlag = *pi_asf;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-
-        if( i_ret < 0 )
-        {
-            return i_ret;
-        }
-
-        *pi_asf = ((PDVD_ASF)key->KeyData)->SuccessFlag;
-    }
-    else
-    {
-        INIT_SSC( GPCMD_REPORT_KEY, 8 );
-
-        ssc.CDBByte[ 10 ] = DVD_REPORT_ASF;
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        *pi_asf = p_buffer[ 7 ] & 1;
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_ReportKey1: get the first key from the drive
- *****************************************************************************/
-int ioctl_ReportKey1( int i_fd, int *pi_agid, u8 *p_key )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_LU_SEND_KEY1;
-    auth_info.lsk.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-    memcpy( p_key, auth_info.lsk.key, DVD_KEY_SIZE );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_REPORT_KEY1;
-    auth_info.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-    memcpy( p_key, auth_info.keychal, DVD_KEY_SIZE );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 12 );
-
-    rdc.command[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    memcpy( p_key, p_buffer + 4, DVD_KEY_SIZE );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_REPORT_KEY, 12 );
-
-    sctl_io.cdb[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-    memcpy( p_key, p_buffer + 4, DVD_KEY_SIZE );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 12 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-
-    memcpy( p_key, p_buffer + 4, DVD_KEY_SIZE );
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_report_key_t dvd;
-    DVDKey1Info dvdk1i;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdk1i, 0, sizeof(dvdk1i));
-
-    dvd.buffer = &dvdk1i;
-    dvd.bufferLength = sizeof(dvdk1i);
-    dvd.format = kDVDKeyFormatKey1;
-    dvd.grantID = *pi_agid;
-    
-    /* dvdk1i.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    dvdk1i.dataLength[ 1 ] = 0x0a;
-
-    i_ret = ioctl( i_fd, DKIOCDVDREPORTKEY, &dvd );
-
-    memcpy( p_key, dvdk1i.key1Value, DVD_KEY_SIZE );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_BUS_KEY_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_BUS_KEY_LENGTH;
-        key->SessionId  = *pi_agid;
-        key->KeyType    = DvdBusKey1;
-        key->KeyFlags   = 0;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-
-        memcpy( p_key, key->KeyData, DVD_KEY_SIZE );
-    }
-    else
-    {
-        INIT_SSC( GPCMD_REPORT_KEY, 12 );
-
-        ssc.CDBByte[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6);
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        memcpy( p_key, p_buffer + 4, DVD_KEY_SIZE );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_InvalidateAgid: invalidate the current AGID
- *****************************************************************************/
-int ioctl_InvalidateAgid( int i_fd, int *pi_agid )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_INVALIDATE_AGID;
-    auth_info.lsa.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_INVALIDATE_AGID;
-    auth_info.agid = *pi_agid;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 0 );
-
-    rdc.command[ 10 ] = DVD_INVALIDATE_AGID | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_REPORT_KEY, 0 );
-
-    sctl_io.cdb[ 10 ] = DVD_INVALIDATE_AGID | (*pi_agid << 6);
-
-    i_ret = ioctl( i_fd, SIOC_IO, &sctl_io );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 0 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_INVALIDATE_AGID | (*pi_agid << 6);
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-
-#elif defined( SYS_DARWIN )
-    dk_dvd_send_key_t dvd;
-    DVDAuthenticationGrantIDInfo dvdagid;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdagid, 0, sizeof(dvdagid));
-
-    dvd.buffer = &dvdagid;
-    dvd.bufferLength = sizeof(dvdagid);
-    dvd.format = kDVDKeyFormatAGID_Invalidate;
-    dvd.grantID = *pi_agid;
-    dvdagid.grantID = *pi_agid; /* we need this? */
-    
-    /* dvdagid.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    /* dvdagid.dataLength[1] = 0x06; */
-
-    i_ret = ioctl( i_fd, DKIOCDVDSENDKEY, &dvd );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_END_SESSION, 
-                    pi_agid, sizeof( *pi_agid ), NULL, 0, &tmp, NULL ) ? 0 : -1;
-    }
-    else
-    {
-#if defined( __MINGW32__ )
-        INIT_SSC( GPCMD_REPORT_KEY, 0 );
-#else
-        INIT_SSC( GPCMD_REPORT_KEY, 1 );
-
-        ssc.SRB_BufLen    = 0;
-        ssc.CDBByte[ 8 ]  = 0;
-        ssc.CDBByte[ 9 ]  = 0;
-#endif
-
-        ssc.CDBByte[ 10 ] = DVD_INVALIDATE_AGID | (*pi_agid << 6);
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_SendChallenge: send challenge to the drive
- *****************************************************************************/
-int ioctl_SendChallenge( int i_fd, int *pi_agid, u8 *p_challenge )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_HOST_SEND_CHALLENGE;
-    auth_info.hsc.agid = *pi_agid;
-
-    memcpy( auth_info.hsc.chal, p_challenge, DVD_CHALLENGE_SIZE );
-
-    return ioctl( i_fd, DVD_AUTH, &auth_info );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_SEND_CHALLENGE;
-    auth_info.agid = *pi_agid;
-
-    memcpy( auth_info.keychal, p_challenge, DVD_CHALLENGE_SIZE );
-
-    return ioctl( i_fd, DVDIOCSENDKEY, &auth_info );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_SEND_KEY, 16 );
-
-    rdc.command[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
-
-    p_buffer[ 1 ] = 0xe;
-    memcpy( p_buffer + 4, p_challenge, DVD_CHALLENGE_SIZE );
-
-    return ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_SEND_KEY, 16 );
-
-    sctl_io.cdb[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
-
-    p_buffer[ 1 ] = 0xe;
-    memcpy( p_buffer + 4, p_challenge, DVD_CHALLENGE_SIZE );
-
-    return ioctl( i_fd, SIOC_IO, &sctl_io );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_SEND_KEY, 16 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
-    
-    p_buffer[ 1 ] = 0xe;
-    memcpy( p_buffer + 4, p_challenge, DVD_CHALLENGE_SIZE );
-    
-    if( ioctl( i_fd, USCSICMD, &sc ) < 0 || sc.uscsi_status )
-    {
-        return -1;
-    }
-
-    return 0;
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_send_key_t dvd;
-    DVDChallengeKeyInfo dvdcki;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdcki, 0, sizeof(dvdcki));
-
-    dvd.buffer = &dvdcki;
-    dvd.bufferLength = sizeof(dvdcki);
-    dvd.format = kDVDKeyFormatChallengeKey;
-    dvd.grantID = *pi_agid;
-
-    /* dvdcki.dataLength[0] = 0x00; */ /* dataLength[0] is already memset to 0 */
-    dvdcki.dataLength[ 1 ] = 0x0e;
-
-    memcpy( dvdcki.challengeKeyValue, p_challenge, DVD_CHALLENGE_SIZE );
-
-    i_ret = ioctl( i_fd, DKIOCDVDSENDKEY, &dvd );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_CHALLENGE_KEY_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_CHALLENGE_KEY_LENGTH;
-        key->SessionId  = *pi_agid;
-        key->KeyType    = DvdChallengeKey;
-        key->KeyFlags   = 0;
-
-        memcpy( key->KeyData, p_challenge, DVD_CHALLENGE_SIZE );
-
-        return DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_SEND_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-    }
-    else
-    {
-        INIT_SSC( GPCMD_SEND_KEY, 16 );
-
-        ssc.CDBByte[ 10 ] = DVD_SEND_CHALLENGE | (*pi_agid << 6);
-
-        p_buffer[ 1 ] = 0xe;
-        memcpy( p_buffer + 4, p_challenge, DVD_CHALLENGE_SIZE );
-
-        return WinSendSSC( i_fd, &ssc );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    return -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_SendKey2: send the second key to the drive
- *****************************************************************************/
-int ioctl_SendKey2( int i_fd, int *pi_agid, u8 *p_key )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT )
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_HOST_SEND_KEY2;
-    auth_info.hsk.agid = *pi_agid;
-
-    memcpy( auth_info.hsk.key, p_key, DVD_KEY_SIZE );
-
-    return ioctl( i_fd, DVD_AUTH, &auth_info );
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_SEND_KEY2;
-    auth_info.agid = *pi_agid;
-
-    memcpy( auth_info.keychal, p_key, DVD_KEY_SIZE );
-
-    return ioctl( i_fd, DVDIOCSENDKEY, &auth_info );
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_SEND_KEY, 12 );
-
-    rdc.command[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
-
-    p_buffer[ 1 ] = 0xa;
-    memcpy( p_buffer + 4, p_key, DVD_KEY_SIZE );
-
-    return ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-#elif defined( HPUX_SCTL_IO )
-    INIT_SCTL_IO( GPCMD_SEND_KEY, 12 );
-
-    sctl_io.cdb[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
-
-    p_buffer[ 1 ] = 0xa;
-    memcpy( p_buffer + 4, p_key, DVD_KEY_SIZE );
-
-    return ioctl( i_fd, SIOC_IO, &sctl_io );
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_SEND_KEY, 12 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
-    
-    p_buffer[ 1 ] = 0xa;
-    memcpy( p_buffer + 4, p_key, DVD_KEY_SIZE );
-    
-    if( ioctl( i_fd, USCSICMD, &sc ) < 0 || sc.uscsi_status )
-    {
-        return -1;
-    }
-
-    return 0;
-    
-#elif defined( SYS_DARWIN )
-    dk_dvd_send_key_t dvd;
-    DVDKey2Info dvdk2i;
-    
-    memset(&dvd, 0, sizeof(dvd));
-    memset(&dvdk2i, 0, sizeof(dvdk2i));
-
-    dvd.buffer = &dvdk2i;
-    dvd.bufferLength = sizeof(dvdk2i);
-    dvd.format = kDVDKeyFormatKey2;
-    dvd.grantID = *pi_agid;
-
-    /* dvdk2i.dataLength[0] = 0x00; */ /*dataLength[0] is already memset to 0 */
-    dvdk2i.dataLength[ 1 ] = 0x0a;
-    
-    memcpy( dvdk2i.key2Value, p_key, DVD_KEY_SIZE );
-
-    i_ret = ioctl( i_fd, DKIOCDVDSENDKEY, &dvd );
-
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[DVD_BUS_KEY_LENGTH];
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_BUS_KEY_LENGTH;
-        key->SessionId  = *pi_agid;
-        key->KeyType    = DvdBusKey2;
-        key->KeyFlags   = 0;
-
-        memcpy( key->KeyData, p_key, DVD_KEY_SIZE );
-
-        return DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_SEND_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-    }
-    else
-    {
-        INIT_SSC( GPCMD_SEND_KEY, 12 );
-
-        ssc.CDBByte[ 10 ] = DVD_SEND_KEY2 | (*pi_agid << 6);
-
-        p_buffer[ 1 ] = 0xa;
-        memcpy( p_buffer + 4, p_key, DVD_KEY_SIZE );
-
-        return WinSendSSC( i_fd, &ssc );
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/*****************************************************************************
- * ioctl_ReportRPC: get RPC status for the drive
- *****************************************************************************/
-int ioctl_ReportRPC( int i_fd, int *p_type, int *p_mask, int *p_scheme )
-{
-    int i_ret;
-
-#if defined( HAVE_LINUX_DVD_STRUCT ) && !defined(__OpenBSD__)
-    dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.type = DVD_LU_SEND_RPC_STATE;
-
-    i_ret = ioctl( i_fd, DVD_AUTH, &auth_info );
-
-    *p_type = auth_info.lrpcs.type;
-    *p_mask = auth_info.lrpcs.region_mask;
-    *p_scheme = auth_info.lrpcs.rpc_scheme;
-
-#elif defined( HAVE_BSD_DVD_STRUCT )
-    struct dvd_authinfo auth_info;
-
-    memset( &auth_info, 0, sizeof( auth_info ) );
-    auth_info.format = DVD_REPORT_RPC;
-
-    i_ret = ioctl( i_fd, DVDIOCREPORTKEY, &auth_info );
-
-    *p_type = auth_info.reg_type;
-    *p_mask = auth_info.region; // ??
-    *p_scheme = auth_info.rpc_scheme;
-
-#elif defined( SYS_BEOS )
-    INIT_RDC( GPCMD_REPORT_KEY, 8 );
-
-    rdc.command[ 10 ] = DVD_REPORT_RPC;
-
-    i_ret = ioctl( i_fd, B_RAW_DEVICE_COMMAND, &rdc, sizeof(rdc) );
-
-    *p_type = p_buffer[ 4 ] >> 6;
-    *p_mask = p_buffer[ 5 ];
-    *p_scheme = p_buffer[ 6 ];
-
-#elif defined( SOLARIS_USCSI )
-    INIT_USCSI( GPCMD_REPORT_KEY, 8 );
-    
-    rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_RPC;
-    
-    i_ret = ioctl( i_fd, USCSICMD, &sc );
-    
-    if( i_ret < 0 || sc.uscsi_status )
-    {
-        i_ret = -1;
-    }
-    
-    *p_type = p_buffer[ 4 ] >> 6;
-    *p_mask = p_buffer[ 5 ];
-    *p_scheme = p_buffer[ 6 ];
-    
-#elif defined( SYS_DARWIN )
-    /* The headers for Darwin / MacOSX are unavaialbe. */
-    /* Someone who has them should have no problem implementing this. */
-    i_ret = -1;
-    
-#elif defined( WIN32 )
-    if( WIN2K ) /* NT/Win2000/Whistler */
-    {
-        DWORD tmp;
-        u8 buffer[ DVD_ASF_LENGTH ]; /* correct this */
-        PDVD_COPY_PROTECT_KEY key = (PDVD_COPY_PROTECT_KEY) &buffer;
-
-        memset( &buffer, 0, sizeof( buffer ) );
-
-        key->KeyLength  = DVD_ASF_LENGTH; /* correct this */
-        key->KeyType    = DvdGetRpcKey;
-        key->KeyFlags   = 0;
-
-#if !defined( _MSC_VER )
-#    warning "Fix ReportRPC for WIN32!"
-#endif
-        /* The IOCTL_DVD_READ_KEY might be the right IOCTL */
-        i_ret = DeviceIoControl( (HANDLE) i_fd, IOCTL_DVD_READ_KEY, key, 
-                key->KeyLength, key, key->KeyLength, &tmp, NULL ) ? 0 : -1;
-
-        /* Someone who has the headers should correct all this. */
-        *p_type = 0;
-        *p_mask = 0;
-        *p_scheme = 0;
-        i_ret = -1; /* Remove this line when implemented. */
-
-    }
-    else
-    {
-        INIT_SSC( GPCMD_REPORT_KEY, 8 );
-
-        ssc.CDBByte[ 10 ] = DVD_REPORT_RPC;
-
-        i_ret = WinSendSSC( i_fd, &ssc );
-
-        *p_type = p_buffer[ 4 ] >> 6;
-        *p_mask = p_buffer[ 5 ];
-        *p_scheme = p_buffer[ 6 ];
-    }
-
-#else
-    /* DVD ioctls unavailable - do as if the ioctl failed */
-    i_ret = -1;
-
-#endif
-    return i_ret;
-}
-
-/* Local prototypes */
-
-#if defined( SYS_BEOS )
-/*****************************************************************************
- * BeInitRDC: initialize a RDC structure for the BeOS kernel
- *****************************************************************************
- * This function initializes a BeOS raw device command structure for future
- * use, either a read command or a write command.
- *****************************************************************************/
-static void BeInitRDC( raw_device_command *p_rdc, int i_type )
-{
-    memset( p_rdc->data, 0, p_rdc->data_length );
-
-    switch( i_type )
-    {
-        case GPCMD_SEND_KEY:
-            /* leave the flags to 0 */
-            break;
-
-        case GPCMD_READ_DVD_STRUCTURE:
-        case GPCMD_REPORT_KEY:
-            p_rdc->flags = B_RAW_DEVICE_DATA_IN;
-            break;
-    }
-
-    p_rdc->command[ 0 ]      = i_type;
-
-    p_rdc->command[ 8 ]      = (p_rdc->data_length >> 8) & 0xff;
-    p_rdc->command[ 9 ]      =  p_rdc->data_length       & 0xff;
-    p_rdc->command_length    = 12;
-
-    p_rdc->sense_data        = NULL;
-    p_rdc->sense_data_length = 0;
-
-    p_rdc->timeout           = 1000000;
-}
-#endif
-
-#if defined( HPUX_SCTL_IO )
-/*****************************************************************************
- * HPUXInitSCTL: initialize a sctl_io structure for the HP-UX kernel
- *****************************************************************************
- * This function initializes a HP-UX command structure for future
- * use, either a read command or a write command.
- *****************************************************************************/
-static void HPUXInitSCTL( struct sctl_io *sctl_io, int i_type )
-{
-    memset( sctl_io->data, 0, sctl_io->data_length );
-
-    switch( i_type )
-    {
-        case GPCMD_SEND_KEY:
-            /* leave the flags to 0 */
-            break;
-
-        case GPCMD_READ_DVD_STRUCTURE:
-        case GPCMD_REPORT_KEY:
-            sctl_io->flags = SCTL_READ;
-            break;
-    }
-
-    sctl_io->cdb[ 0 ]        = i_type;
-
-    sctl_io->cdb[ 8 ]        = (sctl_io->data_length >> 8) & 0xff;
-    sctl_io->cdb[ 9 ]        =  sctl_io->data_length       & 0xff;
-    sctl_io->cdb_length      = 12;
-
-    sctl_io->max_msecs       = 1000000;
-}
-#endif
-
-#if defined( SOLARIS_USCSI )
-/*****************************************************************************
- * SolarisInitUSCSI: initialize a USCSICMD structure for the Solaris kernel
- *****************************************************************************
- * This function initializes a Solaris userspace scsi command structure for 
- * future use, either a read command or a write command.
- *****************************************************************************/
-static void SolarisInitUSCSI( struct uscsi_cmd *p_sc, int i_type )
-{   
-    union scsi_cdb *rs_cdb;
-    memset( p_sc->uscsi_cdb, 0, sizeof( union scsi_cdb ) );
-    memset( p_sc->uscsi_bufaddr, 0, p_sc->uscsi_buflen );
-    
-    switch( i_type )
-    {
-        case GPCMD_SEND_KEY:
-            p_sc->uscsi_flags = USCSI_ISOLATE | USCSI_WRITE;
-            break;
-
-        case GPCMD_READ_DVD_STRUCTURE:
-        case GPCMD_REPORT_KEY:
-            p_sc->uscsi_flags = USCSI_ISOLATE | USCSI_READ;
-            break;
-    }
-    
-    rs_cdb = (union scsi_cdb *)p_sc->uscsi_cdb;
-    
-    rs_cdb->scc_cmd = i_type;
-
-    rs_cdb->cdb_opaque[ 8 ] = (p_sc->uscsi_buflen >> 8) & 0xff;
-    rs_cdb->cdb_opaque[ 9 ] =  p_sc->uscsi_buflen       & 0xff;
-    p_sc->uscsi_cdblen = 12;
-
-    USCSI_TIMEOUT( p_sc, 15 );
-}
-#endif
-
-#if defined( WIN32 )
-/*****************************************************************************
- * WinInitSSC: initialize a ssc structure for the win32 aspi layer
- *****************************************************************************
- * This function initializes a ssc raw device command structure for future
- * use, either a read command or a write command.
- *****************************************************************************/
-static void WinInitSSC( struct SRB_ExecSCSICmd *p_ssc, int i_type )
-{
-    memset( p_ssc->SRB_BufPointer, 0, p_ssc->SRB_BufLen );
-
-    switch( i_type )
-    {
-        case GPCMD_SEND_KEY:
-            p_ssc->SRB_Flags = SRB_DIR_OUT;
-            break;
-
-        case GPCMD_READ_DVD_STRUCTURE:
-        case GPCMD_REPORT_KEY:
-            p_ssc->SRB_Flags = SRB_DIR_IN;
-            break;
-    }
-
-    p_ssc->SRB_Cmd      = SC_EXEC_SCSI_CMD;
-    p_ssc->SRB_Flags    |= SRB_EVENT_NOTIFY;
-
-    p_ssc->CDBByte[ 0 ] = i_type;
-
-    p_ssc->CDBByte[ 8 ] = (u8)(p_ssc->SRB_BufLen >> 8) & 0xff;
-    p_ssc->CDBByte[ 9 ] = (u8) p_ssc->SRB_BufLen       & 0xff;
-    p_ssc->SRB_CDBLen   = 12;
-
-    p_ssc->SRB_SenseLen = SENSE_LEN;
-}
-
-/*****************************************************************************
- * WinSendSSC: send a ssc structure to the aspi layer
- *****************************************************************************/
-static int WinSendSSC( int i_fd, struct SRB_ExecSCSICmd *p_ssc )
-{
-    HANDLE hEvent = NULL;
-    struct w32_aspidev *fd = (struct w32_aspidev *) i_fd;
-
-    hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
-    if( hEvent == NULL )
-    {
-        return -1;
-    }
-
-    p_ssc->SRB_PostProc  = hEvent;
-    p_ssc->SRB_HaId      = LOBYTE( fd->i_sid );
-    p_ssc->SRB_Target    = HIBYTE( fd->i_sid );
-
-    ResetEvent( hEvent );
-    if( fd->lpSendCommand( (void*) p_ssc ) == SS_PENDING )
-        WaitForSingleObject( hEvent, INFINITE );
-
-    CloseHandle( hEvent );
-
-    return p_ssc->SRB_Status == SS_COMP ? 0 : -1;
-}
-#endif
-
diff --git a/extras/libdvdcss/ioctl.h b/extras/libdvdcss/ioctl.h
deleted file mode 100644 (file)
index d29fb9a..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/*****************************************************************************
- * ioctl.h: DVD ioctl replacement function
- *****************************************************************************
- * Copyright (C) 1999-2001 VideoLAN
- * $Id: ioctl.h,v 1.11 2001/12/16 18:00:18 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * 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, USA.
- *****************************************************************************/
-
-int ioctl_ReadCopyright     ( int, int, int * );
-int ioctl_ReadDiscKey       ( int, int *, u8 * );
-int ioctl_ReadTitleKey      ( int, int *, int, u8 * );
-int ioctl_ReportAgid        ( int, int * );
-int ioctl_ReportChallenge   ( int, int *, u8 * );
-int ioctl_ReportKey1        ( int, int *, u8 * );
-int ioctl_ReportASF         ( int, int *, int * );
-int ioctl_InvalidateAgid    ( int, int * );
-int ioctl_SendChallenge     ( int, int *, u8 * );
-int ioctl_SendKey2          ( int, int *, u8 * );
-
-#define DVD_KEY_SIZE 5
-#define DVD_CHALLENGE_SIZE 10
-#define DVD_DISCKEY_SIZE 2048
-
-/*****************************************************************************
- * Common macro, BeOS specific
- *****************************************************************************/
-#if defined( SYS_BEOS )
-#define INIT_RDC( TYPE, SIZE ) \
-    raw_device_command rdc; \
-    u8 p_buffer[ (SIZE) ]; \
-    memset( &rdc, 0, sizeof( raw_device_command ) ); \
-    rdc.data = (char *)p_buffer; \
-    rdc.data_length = (SIZE); \
-    BeInitRDC( &rdc, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, HP-UX specific
- *****************************************************************************/
-#if defined( HPUX_SCTL_IO )
-#define INIT_SCTL_IO( TYPE, SIZE ) \
-    struct sctl_io sctl_io; \
-    u8 p_buffer[ (SIZE) ]; \
-    memset( &sctl_io, 0, sizeof( sctl_io ) ); \
-    sctl_io.data = (void *)p_buffer; \
-    sctl_io.data_length = (SIZE); \
-    HPUXInitSCTL( &sctl_io, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, Solaris specific
- *****************************************************************************/
-#if defined( SOLARIS_USCSI )
-#define USCSI_TIMEOUT( SC, TO ) ( (SC)->uscsi_timeout = (TO) )
-#define USCSI_RESID( SC )       ( (SC)->uscsi_resid )
-#define INIT_USCSI( TYPE, SIZE ) \
-    struct uscsi_cmd sc; \
-    union scsi_cdb rs_cdb; \
-    u8 p_buffer[ (SIZE) ]; \
-    memset( &sc, 0, sizeof( struct uscsi_cmd ) ); \
-    sc.uscsi_cdb = (caddr_t)&rs_cdb; \
-    sc.uscsi_bufaddr = p_buffer; \
-    sc.uscsi_buflen = (SIZE); \
-    SolarisInitUSCSI( &sc, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, Darwin specific
- *****************************************************************************/
-#if defined( SYS_DARWIN )
-#define INIT_DVDIOCTL( SIZE ) \
-    dvdioctl_data_t dvdioctl; \
-    u8 p_buffer[ (SIZE) ]; \
-    dvdioctl.p_buffer = p_buffer; \
-    dvdioctl.i_size = (SIZE); \
-    dvdioctl.i_keyclass = kCSS_CSS2_CPRM; \
-    memset( p_buffer, 0, (SIZE) );
-#endif
-
-/*****************************************************************************
- * Common macro, win32 (ASPI) specific
- *****************************************************************************/
-#if defined( WIN32 )
-#define INIT_SSC( TYPE, SIZE ) \
-    struct SRB_ExecSCSICmd ssc; \
-    u8 p_buffer[ (SIZE) ]; \
-    memset( &ssc, 0, sizeof( struct SRB_ExecSCSICmd ) ); \
-    ssc.SRB_BufPointer = (char *)p_buffer; \
-    ssc.SRB_BufLen = (SIZE); \
-    WinInitSSC( &ssc, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Additional types, OpenBSD specific
- *****************************************************************************/
-#if defined( HAVE_OPENBSD_DVD_STRUCT )
-typedef union dvd_struct dvd_struct;
-typedef union dvd_authinfo dvd_authinfo;
-#endif
-
-/*****************************************************************************
- * Various DVD I/O tables
- *****************************************************************************/
-#if defined( SYS_BEOS ) || defined( WIN32 ) || defined ( SOLARIS_USCSI ) || defined ( HPUX_SCTL_IO )
-    /* The generic packet command opcodes for CD/DVD Logical Units,
-     * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
-#   define GPCMD_READ_DVD_STRUCTURE 0xad
-#   define GPCMD_REPORT_KEY         0xa4
-#   define GPCMD_SEND_KEY           0xa3
-    /* DVD struct types */
-#   define DVD_STRUCT_PHYSICAL      0x00
-#   define DVD_STRUCT_COPYRIGHT     0x01
-#   define DVD_STRUCT_DISCKEY       0x02
-#   define DVD_STRUCT_BCA           0x03
-#   define DVD_STRUCT_MANUFACT      0x04
-    /* Key formats */
-#   define DVD_REPORT_AGID          0x00
-#   define DVD_REPORT_CHALLENGE     0x01
-#   define DVD_SEND_CHALLENGE       0x01
-#   define DVD_REPORT_KEY1          0x02
-#   define DVD_SEND_KEY2            0x03
-#   define DVD_REPORT_TITLE_KEY     0x04
-#   define DVD_REPORT_ASF           0x05
-#   define DVD_SEND_RPC             0x06
-#   define DVD_REPORT_RPC           0x08
-#   define DVD_INVALIDATE_AGID      0x3f
-#endif
-
-/*****************************************************************************
- * win32 ioctl specific
- *****************************************************************************/
-#if defined( WIN32 )
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#define IOCTL_DVD_START_SESSION         CTL_CODE(FILE_DEVICE_DVD, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_READ_KEY              CTL_CODE(FILE_DEVICE_DVD, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_SEND_KEY              CTL_CODE(FILE_DEVICE_DVD, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define IOCTL_DVD_END_SESSION           CTL_CODE(FILE_DEVICE_DVD, 0x0403, METHOD_BUFFERED, FILE_READ_ACCESS)
-
-#define IOCTL_SCSI_PASS_THROUGH_DIRECT  CTL_CODE(FILE_DEVICE_CONTROLLER, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
-
-#define DVD_CHALLENGE_KEY_LENGTH        (12 + sizeof(DVD_COPY_PROTECT_KEY))
-#define DVD_BUS_KEY_LENGTH              (8 + sizeof(DVD_COPY_PROTECT_KEY))
-#define DVD_DISK_KEY_LENGTH             (2048 + sizeof(DVD_COPY_PROTECT_KEY))
-#define DVD_ASF_LENGTH                  (sizeof(DVD_ASF) + sizeof(DVD_COPY_PROTECT_KEY))
-
-#define SCSI_IOCTL_DATA_OUT             0
-#define SCSI_IOCTL_DATA_IN              1
-
-typedef ULONG DVD_SESSION_ID, *PDVD_SESSION_ID;
-
-typedef enum
-{
-    DvdChallengeKey = 0x01,
-    DvdBusKey1,
-    DvdBusKey2,
-    DvdTitleKey,
-    DvdAsf,
-    DvdSetRpcKey = 0x6,
-    DvdGetRpcKey = 0x8,
-    DvdDiskKey = 0x80,
-    DvdInvalidateAGID = 0x3f
-} DVD_KEY_TYPE;
-
-typedef struct _DVD_COPY_PROTECT_KEY
-{
-    ULONG KeyLength;
-    DVD_SESSION_ID SessionId;
-    DVD_KEY_TYPE KeyType;
-    ULONG KeyFlags;
-    union
-    {
-        struct
-        {
-            ULONG FileHandle;
-            ULONG Reserved;   // used for NT alignment
-        };
-        LARGE_INTEGER TitleOffset;
-    } Parameters;
-    UCHAR KeyData[0];
-} DVD_COPY_PROTECT_KEY, *PDVD_COPY_PROTECT_KEY;
-
-typedef struct _DVD_ASF
-{
-    UCHAR Reserved0[3];
-    UCHAR SuccessFlag:1;
-    UCHAR Reserved1:7;
-} DVD_ASF, * PDVD_ASF;
-
-typedef struct _SCSI_PASS_THROUGH_DIRECT
-{
-    USHORT Length;
-    UCHAR ScsiStatus;
-    UCHAR PathId;
-    UCHAR TargetId;
-    UCHAR Lun;
-    UCHAR CdbLength;
-    UCHAR SenseInfoLength;
-    UCHAR DataIn;
-    ULONG DataTransferLength;
-    ULONG TimeOutValue;
-    PVOID DataBuffer;
-    ULONG SenseInfoOffset;
-    UCHAR Cdb[16];
-} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
-
-/*****************************************************************************
- * win32 aspi specific
- *****************************************************************************/
-
-#define WIN2K               ( GetVersion() < 0x80000000 )
-#define ASPI_HAID           0
-#define ASPI_TARGET         0
-
-#define SENSE_LEN           0x0E
-#define SC_EXEC_SCSI_CMD    0x02
-#define SC_GET_DISK_INFO    0x06
-#define SS_COMP             0x01
-#define SS_PENDING          0x00
-#define SS_NO_ADAPTERS      0xE8
-#define SRB_DIR_IN          0x08
-#define SRB_DIR_OUT         0x10
-#define SRB_EVENT_NOTIFY    0x40
-
-struct w32_aspidev
-{
-    long  hASPI;
-    short i_sid;
-    int   i_blocks;
-    long  (*lpSendCommand)( void* );
-};
-
-#pragma pack(1)
-
-struct SRB_GetDiskInfo
-{
-    unsigned char   SRB_Cmd;
-    unsigned char   SRB_Status;
-    unsigned char   SRB_HaId;
-    unsigned char   SRB_Flags;
-    unsigned long   SRB_Hdr_Rsvd;
-    unsigned char   SRB_Target;
-    unsigned char   SRB_Lun;
-    unsigned char   SRB_DriveFlags;
-    unsigned char   SRB_Int13HDriveInfo;
-    unsigned char   SRB_Heads;
-    unsigned char   SRB_Sectors;
-    unsigned char   SRB_Rsvd1[22];
-};
-
-struct SRB_ExecSCSICmd
-{
-    unsigned char   SRB_Cmd;
-    unsigned char   SRB_Status;
-    unsigned char   SRB_HaId;
-    unsigned char   SRB_Flags;
-    unsigned long   SRB_Hdr_Rsvd;
-    unsigned char   SRB_Target;
-    unsigned char   SRB_Lun;
-    unsigned short  SRB_Rsvd1;
-    unsigned long   SRB_BufLen;
-    unsigned char   *SRB_BufPointer;
-    unsigned char   SRB_SenseLen;
-    unsigned char   SRB_CDBLen;
-    unsigned char   SRB_HaStat;
-    unsigned char   SRB_TargStat;
-    unsigned long   *SRB_PostProc;
-    unsigned char   SRB_Rsvd2[20];
-    unsigned char   CDBByte[16];
-    unsigned char   SenseArea[SENSE_LEN+2];
-};
-
-#pragma pack()
-
-#endif
-
diff --git a/extras/libdvdcss/libdvdcss.c b/extras/libdvdcss/libdvdcss.c
deleted file mode 100644 (file)
index 05dd587..0000000
+++ /dev/null
@@ -1,984 +0,0 @@
-/*****************************************************************************
- * libdvdcss.c: DVD reading library.
- *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.c,v 1.30 2002/01/23 03:15:31 stef Exp $
- *
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- *          Samuel Hocevar <sam@zoy.org>
- *          Håkan Hjort <d95hjort@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, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <videolan/vlc.h>
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
-#if defined( WIN32 )
-#   include <io.h>                                                 /* read() */
-#else
-#   include <sys/uio.h>                                      /* struct iovec */
-#endif
-
-#if defined( WIN32 )
-#   include "input_iovec.h"
-#endif
-
-#include "videolan/dvdcss.h"
-#include "libdvdcss.h"
-#include "ioctl.h"
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int _dvdcss_open  ( dvdcss_handle, char *psz_target );
-static int _dvdcss_close ( dvdcss_handle );
-static int _dvdcss_readv ( dvdcss_handle, struct iovec *p_iovec, int i_blocks );
-
-/*****************************************************************************
- * Local prototypes, win32 specific
- *****************************************************************************/
-#if defined( WIN32 )
-static int _win32_dvdcss_readv  ( int i_fd, struct iovec *p_iovec,
-                                  int i_num_buffers, char *p_tmp_buffer );
-static int _win32_dvdcss_aopen  ( char c_drive, dvdcss_handle dvdcss );
-static int _win32_dvdcss_aclose ( int i_fd );
-static int _win32_dvdcss_aseek  ( int i_fd, int i_blocks, int i_method );
-static int _win32_dvdcss_aread  ( int i_fd, void *p_data, int i_blocks );
-#else
-static int _dvdcss_raw_open     ( dvdcss_handle, char *psz_target );
-#endif
-
-/*****************************************************************************
- * dvdcss_open: initialize library, open a DVD device, crack CSS key
- *****************************************************************************/
-extern dvdcss_handle dvdcss_open ( char *psz_target )
-{
-    struct stat fileinfo;
-    int         i_ret;
-
-    char *psz_method = getenv( "DVDCSS_METHOD" );
-    char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
-#ifndef WIN32
-    char *psz_raw_device = getenv( "DVDCSS_RAW_DEVICE" );
-#endif
-
-    dvdcss_handle dvdcss;
-
-    /* Allocate the library structure */
-    dvdcss = malloc( sizeof( struct dvdcss_s ) );
-    if( dvdcss == NULL )
-    {
-        return NULL;
-    }
-
-    /* Initialize structure with default values */
-    dvdcss->p_titles = NULL;
-    dvdcss->psz_error = "no error";
-    dvdcss->i_method = DVDCSS_METHOD_TITLE;
-    dvdcss->b_debug = 0;
-    dvdcss->b_errors = 1;
-
-    /* Find method from DVDCSS_METHOD environment variable */
-    if( psz_method != NULL )
-    {
-        if( !strncmp( psz_method, "key", 4 ) )
-        {
-            dvdcss->i_method = DVDCSS_METHOD_KEY;
-        }
-        else if( !strncmp( psz_method, "disc", 5 ) )
-        {
-            dvdcss->i_method = DVDCSS_METHOD_DISC;
-        }
-        else if( !strncmp( psz_method, "title", 5 ) )
-        {
-            dvdcss->i_method = DVDCSS_METHOD_TITLE;
-        }
-        else
-        {
-            _dvdcss_error( dvdcss, "unknown decrypt method, please choose "
-                                   "from 'title', 'key' or 'disc'" );
-            free( dvdcss );
-            return NULL;
-        }
-    }
-
-    /* Find verbosity from DVDCSS_VERBOSE environment variable */
-    if( psz_verbose != NULL )
-    {
-        switch( atoi( psz_verbose ) )
-        {
-        case 0:
-            dvdcss->b_errors = 0;
-            break;
-        case 1:
-            break;
-        case 2:
-            dvdcss->b_debug = 1;
-            break;
-        default:
-            _dvdcss_error( dvdcss, "unknown verbose level, please choose "
-                                   "from '0', '1' or '2'" );
-            free( dvdcss );
-            return NULL;
-            break;
-        }
-    }
-
-    /* Open device */
-    i_ret = _dvdcss_open( dvdcss, psz_target );
-    if( i_ret < 0 )
-    {
-        free( dvdcss );
-        return NULL;
-    }
-
-#if defined( WIN32 )
-    /* it's not possible to stat a drive letter. Fake a block device */
-    fileinfo.st_mode = S_IFBLK;
-#else
-    if( stat( psz_target, &fileinfo ) < 0 )
-    {
-        _dvdcss_error( dvdcss, "dvdcss: can't stat target" );
-    }
-#endif
-
-    if( S_ISBLK( fileinfo.st_mode ) || 
-        S_ISCHR( fileinfo.st_mode ) )
-    {        
-        i_ret = CSSTest( dvdcss );
-        if( i_ret < 0 )
-        {
-            _dvdcss_error( dvdcss, "CSS test failed" );
-            /* Disable the CSS ioctls and hope that it works? */
-            dvdcss->b_ioctls = 0;
-            dvdcss->b_encrypted = 1;
-        }
-        else
-        {
-            dvdcss->b_ioctls = 1;
-            dvdcss->b_encrypted = i_ret;
-        }
-    }
-    else
-    {
-        _dvdcss_debug( dvdcss, "dvdcss: file mode, using title method" );
-        dvdcss->i_method = DVDCSS_METHOD_TITLE;
-        dvdcss->b_ioctls = 0;
-        dvdcss->b_encrypted = 1;
-    }
-
-    /* If disc is CSS protected and the ioctls work, authenticate the drive */
-    if( dvdcss->b_encrypted && dvdcss->b_ioctls )
-    {
-        i_ret = CSSGetDiscKey( dvdcss );
-
-        if( i_ret < 0 )
-        {
-            _dvdcss_close( dvdcss );
-            free( dvdcss );
-            return NULL;
-        }
-        
-        memset( dvdcss->css.p_unenc_key, 0, KEY_SIZE );
-    }
-    memset( dvdcss->css.p_title_key, 0, KEY_SIZE );
-
-#ifndef WIN32
-    if( psz_raw_device != NULL )
-    {
-        _dvdcss_raw_open( dvdcss, psz_raw_device );
-    }
-#endif
-
-    return dvdcss;
-}
-
-/*****************************************************************************
- * dvdcss_error: return the last libdvdcss error message
- *****************************************************************************/
-extern char * dvdcss_error ( dvdcss_handle dvdcss )
-{
-    return dvdcss->psz_error;
-}
-
-/*****************************************************************************
- * dvdcss_seek: seek into the device
- *****************************************************************************/
-extern int dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks, int i_flags )
-{
-    /* title cracking method is too slow to be used at each seek */
-    if( ( ( i_flags & DVDCSS_SEEK_MPEG )
-             && ( dvdcss->i_method != DVDCSS_METHOD_TITLE ) )
-             && dvdcss->b_encrypted )
-    {
-        int     i_ret;
-
-        /* Crack or decrypt CSS title key for current VTS */
-        i_ret = CSSGetTitleKey( dvdcss, i_blocks );
-
-        if( i_ret < 0 )
-        {
-            _dvdcss_error( dvdcss, "fatal error in vts css key" );
-            return i_ret;
-        }
-        else if( i_ret > 0 )
-        {
-            _dvdcss_error( dvdcss, "decryption unavailable" );
-            return -1;
-        }
-    }
-    else if( i_flags & DVDCSS_SEEK_KEY )
-    {
-        /* check the title key */
-        if( dvdcss_title( dvdcss, i_blocks ) ) 
-        {
-            return -1;
-        }
-    }
-
-    return _dvdcss_seek( dvdcss, i_blocks );
-}
-
-/*****************************************************************************
- * dvdcss_title: crack or decrypt the current title key if needed
- *****************************************************************************
- * This function should only be called by dvdcss_seek and should eventually
- * not be external if possible.
- *****************************************************************************/
-extern int dvdcss_title ( dvdcss_handle dvdcss, int i_block )
-{
-    dvd_title_t *p_title;
-    dvd_title_t *p_newtitle;
-    int          i_ret;
-
-    if( ! dvdcss->b_encrypted )
-    {
-        return 0;
-    }
-
-    /* Check if we've already cracked this key */
-    p_title = dvdcss->p_titles;
-    while( p_title != NULL
-            && p_title->p_next != NULL
-            && p_title->p_next->i_startlb <= i_block )
-    {
-        p_title = p_title->p_next;
-    }
-
-    if( p_title != NULL
-         && p_title->i_startlb == i_block )
-    {
-        /* We've already cracked this key, nothing to do */
-        memcpy( dvdcss->css.p_title_key, p_title->p_key, sizeof(dvd_key_t) );
-        return 0;
-    }
-
-    /* Crack or decrypt CSS title key for current VTS */
-    i_ret = CSSGetTitleKey( dvdcss, i_block );
-
-    if( i_ret < 0 )
-    {
-        _dvdcss_error( dvdcss, "fatal error in vts css key" );
-        return i_ret;
-    }
-    else if( i_ret > 0 )
-    {
-        _dvdcss_error( dvdcss, "decryption unavailable" );
-        return -1;
-    }
-
-    /* Find our spot in the list */
-    p_newtitle = NULL;
-    p_title = dvdcss->p_titles;
-    while( ( p_title != NULL ) && ( p_title->i_startlb < i_block ) )
-    {
-        p_newtitle = p_title;
-        p_title = p_title->p_next;
-    }
-
-    /* Save the found title */
-    p_title = p_newtitle;
-
-    /* Write in the new title and its key */
-    p_newtitle = malloc( sizeof( dvd_title_t ) );
-    p_newtitle->i_startlb = i_block;
-    memcpy( p_newtitle->p_key, dvdcss->css.p_title_key, KEY_SIZE );
-
-    /* Link the new title, either at the beginning or inside the list */
-    if( p_title == NULL )
-    {
-        dvdcss->p_titles = p_newtitle;
-        p_newtitle->p_next = NULL;
-    }
-    else
-    {
-        p_newtitle->p_next = p_title->p_next;
-        p_title->p_next = p_newtitle;
-    }
-
-    return 0;
-}
-
-#define Pkey dvdcss->css.p_title_key
-/*****************************************************************************
- * dvdcss_read: read data from the device, decrypt if requested
- *****************************************************************************/
-extern int dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
-                                               int i_blocks,
-                                               int i_flags )
-{
-    int i_ret, i_index;
-
-    i_ret = _dvdcss_read( dvdcss, p_buffer, i_blocks );
-
-    if( i_ret <= 0
-         || !dvdcss->b_encrypted
-         || !(i_flags & DVDCSS_READ_DECRYPT) )
-    {
-        return i_ret;
-    }
-
-    /* For what we believe is an unencrypted title, 
-       check that there are no encrypted blocks */
-    if( !( Pkey[0] | Pkey[1] | Pkey[2] | Pkey[3] | Pkey[4] ) ) 
-    {
-        for( i_index = i_ret; i_index; i_index-- )
-        {
-            if( ((u8*)p_buffer)[0x14] & 0x30 )
-            {
-                _dvdcss_error( dvdcss, "no key but found encrypted block" );
-                /* Only return the initial range of unscrambled blocks? */
-                i_ret = i_index;
-                /* or fail completely? return 0; */
-            }
-            (u8*)p_buffer += DVDCSS_BLOCK_SIZE;
-        }
-    }
-
-    /* Decrypt the blocks we managed to read */
-    for( i_index = i_ret; i_index; i_index-- )
-    {
-        CSSDescrambleSector( dvdcss->css.p_title_key, p_buffer );
-        ((u8*)p_buffer)[0x14] &= 0x8f;
-        (u8*)p_buffer += DVDCSS_BLOCK_SIZE;
-    }
-
-    return i_ret;
-}
-
-/*****************************************************************************
- * dvdcss_readv: read data to an iovec structure, decrypt if requested
- *****************************************************************************/
-extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
-                                                int i_blocks,
-                                                int i_flags )
-{
-#define P_IOVEC ((struct iovec*)p_iovec)
-    int i_ret, i_index;
-    void *iov_base;
-    size_t iov_len;
-
-    i_ret = _dvdcss_readv( dvdcss, P_IOVEC, i_blocks );
-
-    if( i_ret <= 0
-         || !dvdcss->b_encrypted
-         || !(i_flags & DVDCSS_READ_DECRYPT) )
-    {
-        return i_ret;
-    }
-
-
-    /* Initialize loop for decryption */
-    iov_base = P_IOVEC->iov_base;
-    iov_len = P_IOVEC->iov_len;
-
-    /* Decrypt the blocks we managed to read */
-    for( i_index = i_ret; i_index; i_index-- )
-    {
-        /* Check that iov_len is a multiple of 2048 */
-        if( iov_len & 0x7ff )
-        {
-            return -1;
-        }
-
-        while( iov_len == 0 )
-        {
-            P_IOVEC++;
-            iov_base = P_IOVEC->iov_base;
-            iov_len = P_IOVEC->iov_len;
-        }
-
-        CSSDescrambleSector( dvdcss->css.p_title_key, iov_base );
-        ((u8*)iov_base)[0x14] &= 0x8f;
-
-        (u8*)iov_base += DVDCSS_BLOCK_SIZE;
-        (u8*)iov_len -= DVDCSS_BLOCK_SIZE;
-    }
-
-    return i_ret;
-#undef P_IOVEC
-}
-#undef Pkey
-
-/*****************************************************************************
- * dvdcss_close: close the DVD device and clean up the library
- *****************************************************************************/
-extern int dvdcss_close ( dvdcss_handle dvdcss )
-{
-    dvd_title_t *p_title;
-    int i_ret;
-
-    /* Free our list of keys */
-    p_title = dvdcss->p_titles;
-    while( p_title )
-    {
-        dvd_title_t *p_tmptitle = p_title->p_next;
-        free( p_title );
-        p_title = p_tmptitle;
-    }
-
-    i_ret = _dvdcss_close( dvdcss );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    free( dvdcss );
-
-    return 0;
-}
-
-/* Following functions are local */
-
-static int _dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
-{
-#if defined( WIN32 )
-    if( WIN2K )
-    {
-        char psz_dvd[7];
-        _snprintf( psz_dvd, 7, "\\\\.\\%c:", psz_target[0] );
-
-        /* To have access to ioctls, we need read and write access to the
-         * device. This is only allowed if you have administrator priviledges
-         * so we allow for a fallback method where ioctls are not available but
-         * we at least have read access to the device.
-         * (See Microsoft Q241374: Read and Write Access Required for SCSI
-         * Pass Through Requests) */
-        (HANDLE) dvdcss->i_fd =
-                CreateFile( psz_dvd, GENERIC_READ | GENERIC_WRITE,
-                                FILE_SHARE_READ | FILE_SHARE_WRITE,
-                                NULL, OPEN_EXISTING,
-                                FILE_FLAG_RANDOM_ACCESS, NULL );
-
-        if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )
-            (HANDLE) dvdcss->i_fd =
-                    CreateFile( psz_dvd, GENERIC_READ, FILE_SHARE_READ,
-                                    NULL, OPEN_EXISTING,
-                                    FILE_FLAG_RANDOM_ACCESS, NULL );
-
-        if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )
-        {
-            _dvdcss_error( dvdcss, "failed opening device" );
-            return -1;
-        }
-    }
-    else
-    {
-        dvdcss->i_fd = _win32_dvdcss_aopen( psz_target[0], dvdcss );
-        if( dvdcss->i_fd == -1 )
-        {
-            _dvdcss_error( dvdcss, "failed opening device" );
-            return -1;
-        }
-    }
-
-    /* initialise readv temporary buffer */
-    dvdcss->p_readv_buffer   = NULL;
-    dvdcss->i_readv_buf_size = 0;
-
-#else
-    dvdcss->i_fd = dvdcss->i_read_fd = open( psz_target, 0 );
-
-    if( dvdcss->i_fd == -1 )
-    {
-        _dvdcss_error( dvdcss, "failed opening device" );
-        return -1;
-    }
-
-#endif
-
-    return 0;
-}
-
-#ifndef WIN32
-static int _dvdcss_raw_open ( dvdcss_handle dvdcss, char *psz_target )
-{
-    dvdcss->i_raw_fd = open( psz_target, 0 );
-
-    if( dvdcss->i_raw_fd == -1 )
-    {
-        _dvdcss_error( dvdcss, "failed opening raw device, continuing" );
-        return -1;
-    }
-    else
-    {
-        dvdcss->i_read_fd = dvdcss->i_raw_fd;
-    }
-
-    return 0;
-}
-#endif
-
-static int _dvdcss_close ( dvdcss_handle dvdcss )
-{
-#if defined( WIN32 )
-    if( WIN2K )
-    {
-        CloseHandle( (HANDLE) dvdcss->i_fd );
-    }
-    else
-    {
-        _win32_dvdcss_aclose( dvdcss->i_fd );
-    }
-
-    /* Free readv temporary buffer */
-    if( dvdcss->p_readv_buffer )
-    {
-        free( dvdcss->p_readv_buffer );
-        dvdcss->p_readv_buffer   = NULL;
-        dvdcss->i_readv_buf_size = 0;
-    }
-
-#else
-    close( dvdcss->i_fd );
-
-    if( dvdcss->i_raw_fd >= 0 )
-    {
-        close( dvdcss->i_raw_fd );
-        dvdcss->i_raw_fd = -1;
-    }
-
-#endif
-
-    return 0;
-}
-
-int _dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
-{
-#if defined( WIN32 )
-    dvdcss->i_seekpos = i_blocks;
-
-    if( WIN2K )
-    {
-        LARGE_INTEGER li_read;
-
-#ifndef INVALID_SET_FILE_POINTER
-#define INVALID_SET_FILE_POINTER ((DWORD)-1)
-#endif
-
-        li_read.QuadPart = (LONGLONG)i_blocks * DVDCSS_BLOCK_SIZE;
-
-        li_read.LowPart = SetFilePointer( (HANDLE) dvdcss->i_fd,
-                                          li_read.LowPart,
-                                          &li_read.HighPart, FILE_BEGIN );
-        if( (li_read.LowPart == INVALID_SET_FILE_POINTER)
-            && GetLastError() != NO_ERROR)
-        {
-            li_read.QuadPart = -DVDCSS_BLOCK_SIZE;
-        }
-
-        li_read.QuadPart /= DVDCSS_BLOCK_SIZE;
-        return (int)li_read.QuadPart;
-    }
-    else
-    {
-        return ( _win32_dvdcss_aseek( dvdcss->i_fd, i_blocks, SEEK_SET ) );
-    }
-#else
-    off_t   i_read;
-
-    dvdcss->i_seekpos = i_blocks;
-
-    i_read = lseek( dvdcss->i_read_fd,
-                    (off_t)i_blocks * (off_t)DVDCSS_BLOCK_SIZE, SEEK_SET );
-
-    return i_read / DVDCSS_BLOCK_SIZE;
-#endif
-
-}
-
-int _dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer, int i_blocks )
-{
-#if defined( WIN32 ) 
-    if( WIN2K )
-    {
-        int i_bytes;
-
-        if( !ReadFile( (HANDLE) dvdcss->i_fd, p_buffer,
-                  i_blocks * DVDCSS_BLOCK_SIZE,
-                  (LPDWORD)&i_bytes, NULL ) )
-        {
-            return -1;
-        }
-        return i_bytes / DVDCSS_BLOCK_SIZE;
-    }
-    else
-    {
-        return _win32_dvdcss_aread( dvdcss->i_fd, p_buffer, i_blocks );
-    }
-
-#else
-    int i_bytes;
-
-    i_bytes = read( dvdcss->i_read_fd, p_buffer,
-                    (size_t)i_blocks * DVDCSS_BLOCK_SIZE );
-    return i_bytes / DVDCSS_BLOCK_SIZE;
-#endif
-
-}
-
-static int _dvdcss_readv ( dvdcss_handle dvdcss, struct iovec *p_iovec,
-                           int i_blocks )
-{
-    int i_read;
-
-#if defined( WIN32 )
-    /* Check the size of the readv temp buffer, just in case we need to
-     * realloc something bigger */
-    if( dvdcss->i_readv_buf_size < i_blocks * DVDCSS_BLOCK_SIZE )
-    {
-        dvdcss->i_readv_buf_size = i_blocks * DVDCSS_BLOCK_SIZE;
-
-        if( dvdcss->p_readv_buffer ) free( dvdcss->p_readv_buffer );
-
-        /* Allocate a buffer which will be used as a temporary storage
-         * for readv */
-        dvdcss->p_readv_buffer = malloc( dvdcss->i_readv_buf_size );
-        if( !dvdcss->p_readv_buffer )
-        {
-            _dvdcss_error( dvdcss, " failed (readv)" );
-            return -1;
-        }
-    }
-
-    i_read = _win32_dvdcss_readv( dvdcss->i_fd, p_iovec, i_blocks,
-                                  dvdcss->p_readv_buffer );
-    return i_read;
-
-#else
-    i_read = readv( dvdcss->i_read_fd, p_iovec, i_blocks );
-    return i_read / DVDCSS_BLOCK_SIZE;
-
-#endif
-}
-
-
-#if defined( WIN32 )
-
-/*****************************************************************************
- * _win32_dvdcss_readv: vectored read using ReadFile for Win2K and
- *                      _win32_dvdcss_aread for win9x
- *****************************************************************************/
-static int _win32_dvdcss_readv( int i_fd, struct iovec *p_iovec,
-                                int i_num_buffers, char *p_tmp_buffer )
-{
-    int i_index;
-    int i_blocks, i_blocks_total = 0;
-
-    for( i_index = i_num_buffers; i_index; i_index-- )
-    {
-        i_blocks_total += p_iovec[i_index-1].iov_len; 
-    }
-
-    if( i_blocks_total <= 0 ) return 0;
-
-    i_blocks_total /= DVDCSS_BLOCK_SIZE;
-
-    if( WIN2K )
-    {
-        unsigned long int i_bytes;
-        if( !ReadFile( (HANDLE)i_fd, p_tmp_buffer,
-                       i_blocks_total * DVDCSS_BLOCK_SIZE, &i_bytes, NULL ) )
-        {
-            return -1;
-            /* The read failed... too bad.
-               As in the posix spec the file postition is left
-               unspecified after a failure */
-        }
-        i_blocks = i_bytes / DVDCSS_BLOCK_SIZE;
-    }
-    else /* Win9x */
-    {
-        i_blocks = _win32_dvdcss_aread( i_fd, p_tmp_buffer, i_blocks_total );
-        if( i_blocks < 0 )
-        {
-            return -1;  /* idem */
-        }
-    }
-
-    /* We just have to copy the content of the temp buffer into the iovecs */
-    i_index = 0;
-    i_blocks_total = i_blocks;
-    while( i_blocks_total > 0 )
-    {
-        memcpy( p_iovec[i_index].iov_base,
-                &p_tmp_buffer[(i_blocks - i_blocks_total) * DVDCSS_BLOCK_SIZE],
-                p_iovec[i_index].iov_len );
-        /* if we read less blocks than asked, we'll just end up copying
-           garbage, this isn't an issue as we return the number of
-           blocks actually read */
-        i_blocks_total -= ( p_iovec[i_index].iov_len / DVDCSS_BLOCK_SIZE );
-        i_index++;
-    } 
-
-    return i_blocks;
-}
-
-/*****************************************************************************
- * _win32_dvdcss_aopen: open dvd drive (load aspi and init w32_aspidev
- *                      structure)
- *****************************************************************************/
-static int _win32_dvdcss_aopen( char c_drive, dvdcss_handle dvdcss )
-{
-    HMODULE hASPI;
-    DWORD dwSupportInfo;
-    struct w32_aspidev *fd;
-    int i, j, i_hostadapters;
-    long (*lpGetSupport)( void );
-    long (*lpSendCommand)( void* );
-     
-    hASPI = LoadLibrary( "wnaspi32.dll" );
-    if( hASPI == NULL )
-    {
-        _dvdcss_error( dvdcss, "unable to load wnaspi32.dll" );
-        return -1;
-    }
-
-    (FARPROC) lpGetSupport = GetProcAddress( hASPI, "GetASPI32SupportInfo" );
-    (FARPROC) lpSendCommand = GetProcAddress( hASPI, "SendASPI32Command" );
-    if(lpGetSupport == NULL || lpSendCommand == NULL )
-    {
-        _dvdcss_debug( dvdcss, "unable to get aspi function pointers" );
-        FreeLibrary( hASPI );
-        return -1;
-    }
-
-    dwSupportInfo = lpGetSupport();
-
-    if( HIBYTE( LOWORD ( dwSupportInfo ) ) == SS_NO_ADAPTERS )
-    {
-        _dvdcss_debug( dvdcss, "no host adapters found (aspi)" );
-        FreeLibrary( hASPI );
-        return -1;
-    }
-
-    if( HIBYTE( LOWORD ( dwSupportInfo ) ) != SS_COMP )
-    {
-        _dvdcss_error( dvdcss, "unable to initalize aspi layer" );
-        FreeLibrary( hASPI );
-        return -1;
-    }
-
-    i_hostadapters = LOBYTE( LOWORD( dwSupportInfo ) );
-    if( i_hostadapters == 0 )
-    {
-        FreeLibrary( hASPI );
-        return -1;
-    }
-
-    fd = malloc( sizeof( struct w32_aspidev ) );
-    if( fd == NULL )
-    {
-        FreeLibrary( hASPI );
-        return -1;
-    }
-
-    fd->i_blocks = 0;
-    fd->hASPI = (long) hASPI;
-    fd->lpSendCommand = lpSendCommand;
-
-    c_drive = c_drive > 'Z' ? c_drive - 'a' : c_drive - 'A';
-
-    for( i = 0; i < i_hostadapters; i++ )
-    {
-        for( j = 0; j < 15; j++ )
-        {
-            struct SRB_GetDiskInfo srbDiskInfo;
-
-            srbDiskInfo.SRB_Cmd         = SC_GET_DISK_INFO;
-            srbDiskInfo.SRB_HaId        = i;
-            srbDiskInfo.SRB_Flags       = 0;
-            srbDiskInfo.SRB_Hdr_Rsvd    = 0;
-            srbDiskInfo.SRB_Target      = j;
-            srbDiskInfo.SRB_Lun         = 0;
-
-            lpSendCommand( (void*) &srbDiskInfo );
-
-            if( (srbDiskInfo.SRB_Status == SS_COMP) &&
-                (srbDiskInfo.SRB_Int13HDriveInfo == c_drive) )
-            {
-                fd->i_sid = MAKEWORD( i, j );
-                return (int) fd;
-            }
-        }
-    }
-
-    free( (void*) fd );
-    FreeLibrary( hASPI );
-    _dvdcss_debug( dvdcss, "unable to get haid and target (aspi)" );
-    return( -1 );        
-}
-
-/*****************************************************************************
- * _win32_dvdcss_aclose: close dvd drive (unload aspi and free w32_aspidev
- *                       structure)
- *****************************************************************************/
-static int _win32_dvdcss_aclose( int i_fd )
-{
-    struct w32_aspidev *fd = (struct w32_aspidev *) i_fd;
-
-    FreeLibrary( (HMODULE) fd->hASPI );
-    free( (void*) i_fd );
-
-    return 0;
-}
-
-/*****************************************************************************
- * _win32_dvdcss_aseek: aspi version of _dvdcss_seek
- * 
- * returns the number of blocks read.
- *****************************************************************************/
-static int _win32_dvdcss_aseek( int i_fd, int i_blocks, int i_method )
-{
-    int i_old_blocks;
-    char sz_buf[ DVDCSS_BLOCK_SIZE ];
-    struct w32_aspidev *fd = (struct w32_aspidev *) i_fd;
-    
-    i_old_blocks = fd->i_blocks;
-    fd->i_blocks = i_blocks;
-
-    if( _win32_dvdcss_aread( i_fd, sz_buf, 1 ) == -1 )
-    {
-        fd->i_blocks = i_old_blocks;
-        return -1;
-    }
-
-    (fd->i_blocks)--;
-
-    return fd->i_blocks;
-}
-
-/*****************************************************************************
- * _win32_dvdcss_aread: aspi version of _dvdcss_read
- *
- * returns the number of blocks read.
- *****************************************************************************/
-static int _win32_dvdcss_aread( int i_fd, void *p_data, int i_blocks )
-{
-    HANDLE hEvent;
-    struct SRB_ExecSCSICmd ssc;
-    struct w32_aspidev *fd = (struct w32_aspidev *) i_fd;
-
-    /* Create the transfer completion event */
-    hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
-    if( hEvent == NULL )
-    {
-        return -1;
-    }
-
-    memset( &ssc, 0, sizeof( ssc ) );
-
-    ssc.SRB_Cmd         = SC_EXEC_SCSI_CMD;
-    ssc.SRB_Flags       = SRB_DIR_IN | SRB_EVENT_NOTIFY;
-    ssc.SRB_HaId        = LOBYTE( fd->i_sid );
-    ssc.SRB_Target      = HIBYTE( fd->i_sid );
-    ssc.SRB_SenseLen    = SENSE_LEN;
-    
-    ssc.SRB_PostProc = (LPVOID) hEvent;
-    ssc.SRB_BufPointer  = p_data;
-    ssc.SRB_CDBLen      = 12;
-    
-    ssc.CDBByte[0]      = 0xA8; /* RAW */
-    ssc.CDBByte[2]      = (UCHAR) (fd->i_blocks >> 24);
-    ssc.CDBByte[3]      = (UCHAR) (fd->i_blocks >> 16) & 0xff;
-    ssc.CDBByte[4]      = (UCHAR) (fd->i_blocks >> 8) & 0xff;
-    ssc.CDBByte[5]      = (UCHAR) (fd->i_blocks) & 0xff;
-    
-    /* We have to break down the reads into 64kb pieces (ASPI restriction) */
-    if( i_blocks > 32 )
-    {
-        ssc.SRB_BufLen = 32 * DVDCSS_BLOCK_SIZE;
-        ssc.CDBByte[9] = 32;
-        fd->i_blocks  += 32;
-
-        /* Initiate transfer */  
-        ResetEvent( hEvent );
-        fd->lpSendCommand( (void*) &ssc );
-
-        /* transfer the next 64kb (_win32_dvdcss_aread is called recursively)
-         * We need to check the status of the read on return */
-        if( _win32_dvdcss_aread( i_fd, (u8*) p_data + 32 * DVDCSS_BLOCK_SIZE,
-                                 i_blocks - 32) < 0 )
-        {
-            return -1;
-        }
-    }
-    else
-    {
-        /* This is the last transfer */
-        ssc.SRB_BufLen   = i_blocks * DVDCSS_BLOCK_SIZE;
-        ssc.CDBByte[9]   = (UCHAR) i_blocks;
-        fd->i_blocks += i_blocks;
-
-        /* Initiate transfer */  
-        ResetEvent( hEvent );
-        fd->lpSendCommand( (void*) &ssc );
-
-    }
-
-    /* If the command has still not been processed, wait until it's finished */
-    if( ssc.SRB_Status == SS_PENDING )
-    {
-        WaitForSingleObject( hEvent, INFINITE );
-    }
-    CloseHandle( hEvent );
-
-    /* check that the transfer went as planned */
-    if( ssc.SRB_Status != SS_COMP )
-    {
-      return -1;
-    }
-
-    return i_blocks;
-}
-
-#endif
-
diff --git a/extras/libdvdcss/libdvdcss.h b/extras/libdvdcss/libdvdcss.h
deleted file mode 100644 (file)
index 3a12549..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*****************************************************************************
- * private.h: private DVD reading library data
- *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.h,v 1.11 2001/11/26 15:56:36 massiot Exp $
- *
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- *          Samuel Hocevar <sam@zoy.org>
- *
- * 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, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Needed headers
- *****************************************************************************/
-#include "css.h"
-
-/*****************************************************************************
- * The libdvdcss structure
- *****************************************************************************/
-struct dvdcss_s
-{
-    /* File descriptor */
-    int i_fd;
-    int i_seekpos;
-
-    /* Decryption stuff */
-    int          i_method;
-    css_t        css;
-    boolean_t    b_ioctls;
-    boolean_t    b_encrypted;
-    dvd_title_t *p_titles;
-
-    /* Error management */
-    char     *psz_error;
-    boolean_t b_errors;
-    boolean_t b_debug;
-
-#if defined( WIN32 )
-    char *p_readv_buffer;
-    int  i_readv_buf_size;
-#else
-    int i_raw_fd;
-    int i_read_fd;
-#endif
-};
-
-/*****************************************************************************
- * libdvdcss method: used like init flags
- *****************************************************************************/
-#define DVDCSS_METHOD_KEY        0
-#define DVDCSS_METHOD_DISC       1
-#define DVDCSS_METHOD_TITLE      2
-
-/*****************************************************************************
- * Functions used across the library
- *****************************************************************************/
-int _dvdcss_seek  ( dvdcss_handle, int i_blocks );
-int _dvdcss_read  ( dvdcss_handle, void *p_buffer, int i_blocks );
-
-/*****************************************************************************
- * Error management
- *****************************************************************************/
-#if defined( _WIN32 ) && defined( _MSC_VER )
-#   define DVDCSS_ERROR( x ) fprintf( stderr, "libdvdcss error: %s\n", x );
-#   define DVDCSS_DEBUG( x ) fprintf( stderr, "libdvdcss debug: %s\n", x );
-#else
-#   define DVDCSS_ERROR( x... ) fprintf( stderr, "libdvdcss error: %s\n", ##x );
-#   define DVDCSS_DEBUG( x... ) fprintf( stderr, "libdvdcss debug: %s\n", ##x );
-#endif
-
-static __inline__ void _dvdcss_error( dvdcss_handle dvdcss, char *psz_string )
-{
-    if( dvdcss->b_errors )
-    {
-        DVDCSS_ERROR( psz_string );
-    }
-
-    dvdcss->psz_error = psz_string;
-}
-
-static __inline__ void _dvdcss_debug( dvdcss_handle dvdcss, char *psz_string )
-{
-    if( dvdcss->b_debug )
-    {
-        DVDCSS_DEBUG( psz_string );
-    }
-}
-
-
diff --git a/extras/libdvdcss/libdvdcss.spec b/extras/libdvdcss/libdvdcss.spec
deleted file mode 100644 (file)
index d230b03..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# This is borrowed and adapted from Mandrake's Cooker
-%define name   libdvdcss
-%define version        1.0.1-dev
-%define release        1
-%define major          1
-%define lib_name %{name}%{major}
-
-Summary:       A library for accessing DVDs like block device, deciphering CSS encryption if needed.
-Name:          %{name}
-Version:       %{version}
-Release:       %{release}
-
-Source0:       http://www.videolan.org/pub/videolan/libdvcss/%{version}/%{name}-%{version}.tar.bz2
-License:       GPL
-Group:         System/Libraries
-URL:           http://videolan.org/
-BuildRoot:     %_tmppath/%name-%version-%release-root
-
-%description
-libdvdcss is a simple library designed for accessing DVDs like a block device
-without having to bother about the decryption. The important features are:
- * Portability. Currently supported platforms are GNU/Linux, FreeBSD, BeOS
-   and Windows. The MacOS X version is being worked on as well.
- * Simplicity. There are currently 7 functions in the API, and we intend to
-   keep this number low.
- * Freedom. libdvdcss is released under the General Public License, ensuring
-   it will stay free, and used only for free software products.
- * Just better. Unlike most similar projects, libdvdcss doesn't require the
-   region of your drive to be set.
-
-%package -n %{lib_name}
-Summary:        A library for accessing DVDs like block device, deciphering CSS encryption if needed.
-Group:          System/Libraries
-Provides:       %name
-
-%description -n %{lib_name}
-libdvdcss is a simple library designed for accessing DVDs like a block device 
-without having to bother about the decryption. The important features are:
- * Portability. Currently supported platforms are GNU/Linux, FreeBSD, BeOS
-   and Windows. The MacOS X version is being worked on as well.
- * Simplicity. There are currently 7 functions in the API, and we intend to 
-   keep this number low.
- * Freedom. libdvdcss is released under the General Public License, ensuring
-   it will stay free, and used only for free software products.
- * Just better. Unlike most similar projects, libdvdcss doesn't require the 
-   region of your drive to be set.
-
-%package -n %{lib_name}-devel
-Summary:        Development tools for programs which will use the libdvdcss library.
-Group:          Development/C
-Provides:       %name-devel
-Requires:      %{lib_name} = %{version}
-%description -n %{lib_name}-devel
-The %{name}-devel package includes the header files and static libraries
-necessary for developing programs which will manipulate DVDs files using
-the %{name} library.
- If you are going to develop programs which will manipulate DVDs,
- you should install %{name}-devel.  You'll also need to have the %name
- package installed.
-
-%prep
-%setup -q
-
-%build
-%configure
-make libdvdcss
-
-%install
-%makeinstall
-
-%clean
-rm -fr %buildroot
-
-%post -n %{lib_name} -p /sbin/ldconfig
-%postun -n %{lib_name} -p /sbin/ldconfig
-
-%files -n %{lib_name}
-%defattr(-,root,root,-)
-%doc COPYING AUTHORS
-%{_libdir}/*.so.*
-
-%files -n %{lib_name}-devel
-%defattr(-,root,root)
-%doc COPYING
-%{_libdir}/*.a
-%{_libdir}/*.so
-%{_includedir}/*
-
-%changelog
-* Tue Oct 02 2001 Christophe Massiot <massiot@via.ecp.fr>
-- Imported Mandrake's vlc.spec into the CVS
-
-* Thu Aug 23 2001 Yves Duret <yduret@mandrakesoft.com> 0.0.3-1mdk
-- version 0.0.3
-
-* Mon Aug 13 2001 Yves Duret <yduret@mandrakesoft.com> 0.0.2-1mdk
-- version 0.0.2
-
-* Tue Jun 19 2001 Yves Duret <yduret@mandrakesoft.com> 0.0.1-1mdk
-- first release and first mdk release
-
-#EOF
diff --git a/extras/libdvdcss/videolan/dvdcss.h b/extras/libdvdcss/videolan/dvdcss.h
deleted file mode 100644 (file)
index 42c3817..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*****************************************************************************
- * libdvdcss.h: DVD reading library, exported functions.
- *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvdcss.h,v 1.10 2001/11/19 15:13:11 stef Exp $
- *
- * Authors: Stéphane Borel <stef@via.ecp.fr>
- *          Samuel Hocevar <sam@zoy.org>
- *
- * 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, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * The libdvdcss structure
- *****************************************************************************/
-typedef struct dvdcss_s* dvdcss_handle;
-
-/*****************************************************************************
- * Defines and flags
- *****************************************************************************/
-#define DVDCSS_BLOCK_SIZE      2048
-
-#define DVDCSS_NOFLAGS         0
-#define DVDCSS_READ_DECRYPT    (1 << 0)
-#define DVDCSS_SEEK_MPEG       (1 << 0)
-#define DVDCSS_SEEK_KEY        (1 << 1)
-
-/*****************************************************************************
- * Exported prototypes
- *****************************************************************************/
-extern dvdcss_handle dvdcss_open  ( char *psz_target );
-extern int           dvdcss_close ( dvdcss_handle );
-extern int           dvdcss_title ( dvdcss_handle,
-                                    int i_block );
-extern int           dvdcss_seek  ( dvdcss_handle,
-                                    int i_blocks,
-                                    int i_flags );
-extern int           dvdcss_read  ( dvdcss_handle,
-                                    void *p_buffer,
-                                    int i_blocks,
-                                    int i_flags );
-extern int           dvdcss_readv ( dvdcss_handle,
-                                    void *p_iovec,
-                                    int i_blocks,
-                                    int i_flags );
-extern char *        dvdcss_error ( dvdcss_handle );
-
diff --git a/extras/libdvdread/.cvsignore b/extras/libdvdread/.cvsignore
deleted file mode 100644 (file)
index 63e7180..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.dep
diff --git a/extras/libdvdread/Makefile b/extras/libdvdread/Makefile
deleted file mode 100644 (file)
index fb73507..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-###############################################################################
-# vlc (VideoLAN Client) dvdread module Makefile
-# (c)2001 VideoLAN
-###############################################################################
-
-LIBDVDREAD_VERSION := 0.9.2-videolan
-
-BASE_A := libdvdread.a
-BASE_SO := libdvdread.so
-MAJOR_SO := libdvdread.so.$(shell echo $(LIBDVDREAD_VERSION) | cut -f1 -d.)
-FULL_SO := libdvdread.so.$(LIBDVDREAD_VERSION)
-ifneq (,$(SOFLAGS))
-ALL_SOFLAGS := $(SOFLAGS)$(MAJOR_SO)
-SOFLAGS :=
-endif
-
-#
-# C headers directories
-#
-CFLAGS := -I../../include $(CFLAGS_DVDREAD) $(CFLAGS)
-
-#
-# Objects
-#
-
-OBJ_C = dvd_setup.o dvd_reader.o dvd_udf.o nav_print.o nav_read.o ifo_print.o ifo_read.o
-ALL_OBJ = $(OBJ_C) $(OBJ_LIBDVDREAD)
-
-#
-# Standard dependencies
-# 
-C_DEP := $(ALL_OBJ:%.o=.dep/%.d)
-
-#
-# Virtual targets
-#
-all: ../../lib/$(BASE_A) ../../lib/$(FULL_SO)
-
-clean:
-       rm -f $(ALL_OBJ)
-       rm -f *.o
-       rm -rf .dep
-
-install:
-       mkdir -p $(DESTDIR)$(libdir)
-       -$(INSTALL) -m 644 ../../lib/$(BASE_A) $(DESTDIR)$(libdir)
-       -$(INSTALL) -m 644 ../../lib/$(FULL_SO) $(DESTDIR)$(libdir)
-       rm -f $(DESTDIR)$(libdir)/$(BASE_SO) && ln -s $(FULL_SO)                $(DESTDIR)$(libdir)/$(BASE_SO)
-       rm -f $(DESTDIR)$(libdir)/$(MAJOR_SO) && ln -s $(FULL_SO)               $(DESTDIR)$(libdir)/$(MAJOR_SO)
-
-uninstall:
-       rm -f $(DESTDIR)$(libdir)/$(BASE_A)
-       rm -f $(DESTDIR)$(libdir)/$(BASE_SO)
-       rm -f $(DESTDIR)$(libdir)/$(MAJOR_SO)
-       rm -f $(DESTDIR)$(libdir)/$(FULL_SO)
-
-FORCE:
-
-$(ALL_OBJ): %.o: ../../Makefile.dep Makefile
-
-$(C_DEP): %.d: FORCE
-       @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@
-
-$(OBJ_C): %.o: .dep/%.d
-$(OBJ_C): %.o: %.c
-       $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
-
-../../lib/$(FULL_SO): $(OBJ_C) $(OBJ_LIBDVDREAD)
-       $(CC) $(PCFLAGS) $(ALL_SOFLAGS) -o $@ $^ $(PLDFLAGS) $(LIB_LIBDVDREAD)
-       rm -f ../../lib/$(BASE_SO) && ln -s $(FULL_SO) ../../lib/$(BASE_SO)
-       rm -f ../../lib/$(MAJOR_SO) && ln -s $(FULL_SO) ../../lib/$(MAJOR_SO)
-
-../../lib/$(BASE_A): $(OBJ_C) $(OBJ_LIBDVDREAD)
-       ar r $@ $^
-       $(RANLIB) $@
-
diff --git a/extras/libdvdread/bswap.h b/extras/libdvdread/bswap.h
deleted file mode 100644 (file)
index 23e2863..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (C) 2000, 2001 Billy Biggs <vektor@dumbterm.net>,
- *                          Håkan Hjort <d95hjort@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
- */
-
-#ifndef BSWAP_H_INCLUDED
-#define BSWAP_H_INCLUDED
-
-#include <config.h>
-
-#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)
-
-#else 
-
-#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)
-
-/* This is a slow but portable implementation, it has multiple evaluation 
- * problems so beware.
- * FreeBSD and Solaris don't have <byteswap.h> or any other such 
- * functionality! 
- */
-
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__)
-#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))
-
-#else
-
-/* If there isn't a header provided with your system with this functionality
- * add the relevant || define( ) to the portable implementation above.
- */
-#error "You need to add endian swap macros for you're system"
-
-#endif
-
-#endif /* WORDS_BIGENDIAN */
-
-#endif /* BSWAP_H_INCLUDED */
diff --git a/extras/libdvdread/dvd_reader.c b/extras/libdvdread/dvd_reader.c
deleted file mode 100644 (file)
index a155c70..0000000
+++ /dev/null
@@ -1,919 +0,0 @@
-/**
- * Copyright (C) 2001 Billy Biggs <vektor@dumbterm.net>.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/uio.h> /* readv() */
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-#include <dirent.h>
-
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)
-#define SYS_BSD 1
-#endif
-
-#if defined(__sun)
-#include <sys/mnttab.h>
-#elif defined(SYS_BSD)
-#include <fstab.h>
-#elif defined(__linux__)
-#include <mntent.h>
-#endif
-
-#if defined(SYS_BSD)
-typedef off_t off64_t;
-#define lseek64 lseek
-#define stat64 stat
-#endif
-
-#include "dvd_udf.h"
-#include "dvd_reader.h"
-
-#include "dvd_setup.h"
-
-struct dvd_reader_s {
-    /* Basic information. */
-    int isImageFile;
-
-    /* Information required for an image file. */
-    dvd_handle dev;
-
-    /* Information required for a directory path drive. */
-    char *path_root;
-};
-
-struct dvd_file_s {
-    /* Basic information. */
-    dvd_reader_t *dvd;
-
-    /* Information required for an image file. */
-    uint32_t lb_start;
-    uint32_t seek_pos;
-
-    /* Information required for a directory path drive. */
-    dvd_handle title_devs[9];
-    size_t title_sizes[ 9 ];
-
-    /* Calculated at open-time, size in blocks. */
-    ssize_t filesize;
-};
-
-/**
- * Open a DVD image or block device file.
- */
-static dvd_reader_t *DVDOpenImageFile( const char *location )
-{
-    dvd_reader_t *dvd;
-    dvd_handle dev = 0;
-
-    dev = pf_dvd_open( (char *) location );
-    if( !dev ) {
-        fprintf( stderr, "libdvdread: Can't open %s for reading.\n",
-                         location );
-        return 0;
-    }
-
-    dvd = (dvd_reader_t *) malloc( sizeof( dvd_reader_t ) );
-    if( !dvd ) return 0;
-    dvd->isImageFile = 1;
-    dvd->dev = dev;
-    dvd->path_root = 0;
-    
-    return dvd;
-}
-
-static dvd_reader_t *DVDOpenPath( const char *path_root )
-{
-    dvd_reader_t *dvd;
-
-    dvd = (dvd_reader_t *) malloc( sizeof( dvd_reader_t ) );
-    if( !dvd ) return 0;
-    dvd->isImageFile = 0;
-    dvd->dev = 0;
-    dvd->path_root = strdup( path_root );
-
-    return dvd;
-}
-
-#if defined(__sun)
-/* /dev/rdsk/c0t6d0s0 (link to /devices/...)
-   /vol/dev/rdsk/c0t6d0/??
-   /vol/rdsk/<name> */
-static char *sun_block2char( const char *path )
-{
-    char *new_path;
-
-    /* Must contain "/dsk/" */ 
-    if( !strstr( path, "/dsk/" ) ) return (char *) strdup( path );
-
-    /* Replace "/dsk/" with "/rdsk/" */
-    new_path = malloc( strlen(path) + 2 );
-    strcpy( new_path, path );
-    strcpy( strstr( new_path, "/dsk/" ), "" );
-    strcat( new_path, "/rdsk/" );
-    strcat( new_path, strstr( path, "/dsk/" ) + strlen( "/dsk/" ) );
-
-    return new_path;
-}
-#endif
-
-#if defined(SYS_BSD)
-/* FreeBSD /dev/(r)(a)cd0 (a is for atapi, should work without r)
-   OpenBSD /dev/rcd0c
-   NetBSD  /dev/rcd0d or /dev/rcd0c (for non x86)
-   BSD/OS  /dev/sr0 (if not mounted) or /dev/rsr0 */
-static char *bsd_block2char( const char *path )
-{
-    char *new_path;
-
-    /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */ 
-    if( !strncmp( path, "/dev/",  5 ) || strncmp( path, "/dev/r", 6 ) ) 
-      return (char *) strdup( path );
-
-    /* Replace "/dev/" with "/dev/r" */
-    new_path = malloc( strlen(path) + 2 );
-    strcpy( new_path, "/dev/r" );
-    strcat( new_path, path + strlen( "/dev/" ) );
-
-    return new_path;
-}
-#endif
-
-dvd_reader_t *DVDOpen( const char *path )
-{
-    struct stat64 fileinfo;
-    int ret;
-
-    if( !path ) return 0;
-
-    ret = stat64( path, &fileinfo );
-    if( ret < 0 ) {
-        /* If we can't stat the file, give up */
-        fprintf( stderr, "libdvdread: Can't stat %s\n", path );
-        perror("");
-        return 0;
-    }
-
-    /* Try to open libdvdcss or fall back to standard functions */
-    DVDSetupRead();
-
-    /* First check if this is a block/char device or a file */
-    if( S_ISBLK( fileinfo.st_mode ) || 
-    S_ISCHR( fileinfo.st_mode ) || 
-    S_ISREG( fileinfo.st_mode ) ) {
-
-        /**
-         * Block devices and regular files are assumed to be DVD-Video images.
-         */
-#if defined(__sun)
-        return DVDOpenImageFile( sun_block2char( path ) );
-#elif defined(SYS_BSD)
-        return DVDOpenImageFile( bsd_block2char( path ) );
-#else
-        return DVDOpenImageFile( path );
-#endif
-
-    } else if( S_ISDIR( fileinfo.st_mode ) ) {
-        dvd_reader_t *auth_drive = 0;
-        char *path_copy;
-#if defined(SYS_BSD)
-        struct fstab* fe;
-#elif defined(__sun) || defined(__linux__)
-        FILE *mntfile;
-#endif
-
-        fprintf(stderr, "libdvdread: file is directory\n" );
-        /* XXX: We should scream real loud here. */
-        if( !(path_copy = strdup( path ) ) ) return 0;
-
-        /* Resolve any symlinks and get the absolut dir name. */
-        {
-            char *new_path;
-            int cdir = open( ".", O_RDONLY );
-    
-            if( cdir >= 0 ) {
-                chdir( path_copy );
-                new_path = getcwd( NULL, PATH_MAX );
-                fchdir( cdir );
-                close( cdir );
-                if( new_path ) {
-                    free( path_copy );
-                    path_copy = new_path;
-                }
-            }
-        }
-
-        /**
-         * If we're being asked to open a directory, check if that directory
-         * is the mountpoint for a DVD-ROM which we can use instead.
-         */
-
-        if( strlen( path_copy ) > 1 ) {
-            if( path[ strlen( path_copy ) - 1 ] == '/' ) 
-                path_copy[ strlen( path_copy ) - 1 ] = '\0';
-        }
-
-        if( strlen( path_copy ) > 9 ) {
-            if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]), 
-                 "/video_ts" ) ) {
-                path_copy[ strlen( path_copy ) - 9 ] = '\0';
-            }
-        }
-
-#if defined(SYS_BSD)
-        if( ( fe = getfsfile( path_copy ) ) ) {
-            char *dev_name = bsd_block2char( fe->fs_spec );
-            fprintf( stderr,
-                     "libdvdread: Attempting to use device %s"
-                     " mounted on %s for CSS authentication\n",
-                     dev_name,
-                     fe->fs_file );
-            auth_drive = DVDOpenImageFile( dev_name );
-            free( dev_name );
-        }
-#elif defined(__sun)
-        mntfile = fopen( MNTTAB, "r" );
-        if( mntfile ) {
-            struct mnttab mp;
-            int res;
-
-            while( ( res = getmntent( mntfile, &mp ) ) != -1 ) {
-                if( res == 0 && !strcmp( mp.mnt_mountp, path_copy ) ) {
-                    char *dev_name = sun_block2char( mp.mnt_special );
-                    fprintf( stderr, 
-                             "libdvdread: Attempting to use device %s"
-                             " mounted on %s for CSS authentication\n",
-                             dev_name,
-                             mp.mnt_mountp );
-                    auth_drive = DVDOpenImageFile( dev_name );
-                    free( dev_name );
-                    break;
-                }
-            }
-            fclose( mntfile );
-        }
-#elif defined(__linux__)
-        mntfile = fopen( MOUNTED, "r" );
-        if( mntfile ) {
-            struct mntent *me;
-            while( ( me = getmntent( mntfile ) ) ) {
-                if( !strcmp( me->mnt_dir, path_copy ) ) {
-                    fprintf( stderr, 
-                             "libdvdread: Attempting to use device %s"
-                             " mounted on %s for CSS authentication\n",
-                             me->mnt_fsname,
-                             me->mnt_dir );
-                    auth_drive = DVDOpenImageFile( me->mnt_fsname );
-                    break;
-                }
-            }
-            fclose( mntfile );
-        }
-#endif
-        if( !auth_drive ) {
-            fprintf( stderr, "libdvdread: Device inaccessible, "
-                     "CSS authentication not available.\n" );
-        }
-
-        free( path_copy );
-
-        /**
-         * If we've opened a drive, just use that.
-         */
-        if( auth_drive ) return auth_drive;
-
-        /**
-         * Otherwise, we now try to open the directory tree instead.
-         */
-        return DVDOpenPath( path );
-    }
-
-    /* If it's none of the above, screw it. */
-    fprintf( stderr, "libdvdread: Could not open %s\n", path );
-    return 0;
-}
-
-void DVDClose( dvd_reader_t *dvd )
-{
-    if( dvd ) {
-        if( dvd->dev ) pf_dvd_close( dvd->dev );
-        if( dvd->path_root ) free( dvd->path_root );
-        free( dvd );
-        dvd = 0;
-    }
-}
-
-/**
- * Open an unencrypted file on a DVD image file.
- */
-static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, char *filename )
-{
-    uint32_t start, len;
-    dvd_file_t *dvd_file;
-
-    start = UDFFindFile( dvd, filename, &len );
-    if( !start ) return 0;
-
-    dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) );
-    if( !dvd_file ) return 0;
-    dvd_file->dvd = dvd;
-    dvd_file->lb_start = start;
-    dvd_file->seek_pos = 0;
-    memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) );
-    memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
-    dvd_file->filesize = len / DVD_VIDEO_LB_LEN;
-
-    return dvd_file;
-}
-
-/**
- * Searches for <file> in directory <path>, ignoring case.
- * Returns 0 and full filename in <filename>.
- *     or -1 on file not found.
- *     or -2 on path not found.
- */
-static int findDirFile( const char *path, const char *file, char *filename ) 
-{
-    DIR *dir;
-    struct dirent *ent;
-
-    dir = opendir( path );
-    if( !dir ) return -2;
-
-    while( ( ent = readdir( dir ) ) != NULL ) {
-        if( !strcasecmp( ent->d_name, file ) ) {
-            sprintf( filename, "%s%s%s", path,
-                     ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
-                     ent->d_name );
-            return 0;
-        }
-    }
-
-    return -1;
-}
-
-static int findDVDFile( dvd_reader_t *dvd, const char *file, char *filename )
-{
-    char video_path[ PATH_MAX + 1 ];
-    const char *nodirfile;
-    int ret;
-
-    /* Strip off the directory for our search */
-    if( !strncasecmp( "/VIDEO_TS/", file, 10 ) ) {
-        nodirfile = &(file[ 10 ]);
-    } else {
-        nodirfile = file;
-    }
-
-    ret = findDirFile( dvd->path_root, nodirfile, filename );
-    if( ret < 0 ) {
-        /* Try also with adding the path, just in case. */
-        sprintf( video_path, "%s/VIDEO_TS/", dvd->path_root );
-        ret = findDirFile( video_path, nodirfile, filename );
-        if( ret < 0 ) {
-            /* Try with the path, but in lower case. */
-            sprintf( video_path, "%s/video_ts/", dvd->path_root );
-            ret = findDirFile( video_path, nodirfile, filename );
-            if( ret < 0 ) {
-                return 0;
-            }
-        }
-    }
-
-    return 1;
-}
-
-/**
- * Open an unencrypted file from a DVD directory tree.
- */
-static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename )
-{
-    char full_path[ PATH_MAX + 1 ];
-    dvd_file_t *dvd_file;
-    struct stat fileinfo;
-    dvd_handle dev;
-
-    /* Get the full path of the file. */
-    if( !findDVDFile( dvd, filename, full_path ) ) return 0;
-
-    dev = pf_dvd_open( full_path );
-    if( dev == NULL ) return 0;
-
-    dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) );
-    if( !dvd_file ) return 0;
-    dvd_file->dvd = dvd;
-    dvd_file->lb_start = 0;
-    dvd_file->seek_pos = 0;
-    memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) );
-    memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
-    dvd_file->filesize = 0;
-
-    if( stat( full_path, &fileinfo ) < 0 ) {
-        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
-        free( dvd_file );
-        return 0;
-    }
-    dvd_file->title_sizes[ 0 ] = fileinfo.st_size / DVD_VIDEO_LB_LEN;
-    dvd_file->title_devs[ 0 ] = dev;
-    dvd_file->filesize = dvd_file->title_sizes[ 0 ];
-
-    return dvd_file;
-}
-
-static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *dvd, int title, int menu )
-{
-    char filename[ MAX_UDF_FILE_NAME_LEN ];
-    uint32_t start, len;
-    dvd_file_t *dvd_file;
-
-    if( title == 0 ) {
-        sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
-    } else {
-        sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
-    }
-    start = UDFFindFile( dvd, filename, &len );
-    if( start == 0 ) return 0;
-
-    dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) );
-    if( !dvd_file ) return 0;
-    dvd_file->dvd = dvd;
-    dvd_file->lb_start = start;
-    dvd_file->seek_pos = 0;
-    memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) );
-    memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
-    dvd_file->filesize = len / DVD_VIDEO_LB_LEN;
-
-    /* Calculate the complete file size for every file in the VOBS */
-    if( !menu ) {
-        int cur;
-
-        for( cur = 2; cur < 10; cur++ ) {
-            sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
-            if( !UDFFindFile( dvd, filename, &len ) ) break;
-            dvd_file->filesize += len / DVD_VIDEO_LB_LEN;
-        }
-    }
-    
-    if( pf_dvd_seek( dvd_file->dvd->dev, (int)start, DVDCSS_SEEK_KEY ) < 0 ) {
-            fprintf( stderr, "libdvdread: Error cracking CSS key for %s\n",
-                     filename );
-    }
-
-    return dvd_file;
-}
-
-static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *dvd, int title, int menu )
-{
-    char filename[ MAX_UDF_FILE_NAME_LEN ];
-    char full_path[ PATH_MAX + 1 ];
-    struct stat fileinfo;
-    dvd_file_t *dvd_file;
-    int i;
-
-    dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) );
-    if( !dvd_file ) return 0;
-    dvd_file->dvd = dvd;
-    dvd_file->lb_start = 0;
-    dvd_file->seek_pos = 0;
-    memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) );
-    memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
-    dvd_file->filesize = 0;
-
-    if( menu ) {
-        dvd_handle dev;
-
-        if( title == 0 ) {
-            sprintf( filename, "VIDEO_TS.VOB" );
-        } else {
-            sprintf( filename, "VTS_%02i_0.VOB", title );
-        }
-        if( !findDVDFile( dvd, filename, full_path ) ) {
-            free( dvd_file );
-            return 0;
-        }
-
-        dev = pf_dvd_open( full_path );
-        if( dev == NULL ) {
-            free( dvd_file );
-            return 0;
-        }
-
-        if( stat( full_path, &fileinfo ) < 0 ) {
-            fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
-            free( dvd_file );
-            return 0;
-        }
-        dvd_file->title_sizes[ 0 ] = fileinfo.st_size / DVD_VIDEO_LB_LEN;
-        dvd_file->title_devs[ 0 ] = dev;
-        pf_dvd_seek( dvd_file->title_devs[0], 0, DVDCSS_SEEK_KEY );
-        dvd_file->filesize = dvd_file->title_sizes[ 0 ];
-
-    } else {
-        for( i = 0; i < 9; ++i ) {
-
-            sprintf( filename, "VTS_%02i_%i.VOB", title, i + 1 );
-            if( !findDVDFile( dvd, filename, full_path ) ) {
-                break;
-            }
-
-            if( stat( full_path, &fileinfo ) < 0 ) {
-                fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
-                break;
-            }
-
-            dvd_file->title_sizes[ i ] = fileinfo.st_size / DVD_VIDEO_LB_LEN;
-            dvd_file->title_devs[ i ] = pf_dvd_open( full_path );
-            pf_dvd_seek( dvd_file->title_devs[i], 0, DVDCSS_SEEK_KEY );
-            dvd_file->filesize += dvd_file->title_sizes[ i ];
-        }
-        if( !(dvd_file->title_sizes[ 0 ]) ) {
-            free( dvd_file );
-            return 0;
-        }
-    }
-
-    return dvd_file;
-}
-
-dvd_file_t *DVDOpenFile( dvd_reader_t *dvd, int titlenum, 
-                         dvd_read_domain_t domain )
-{
-    char filename[ MAX_UDF_FILE_NAME_LEN ];
-
-    switch( domain ) {
-    case DVD_READ_INFO_FILE:
-        if( titlenum == 0 ) {
-            sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
-        } else {
-            sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
-        }
-        break;
-    case DVD_READ_INFO_BACKUP_FILE:
-        if( titlenum == 0 ) {
-            sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
-        } else {
-            sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
-        }
-        break;
-    case DVD_READ_MENU_VOBS:
-        if( dvd->isImageFile ) {
-            return DVDOpenVOBUDF( dvd, titlenum, 1 );
-        } else {
-            return DVDOpenVOBPath( dvd, titlenum, 1 );
-        }
-        break;
-    case DVD_READ_TITLE_VOBS:
-        if( titlenum == 0 ) return 0;
-        if( dvd->isImageFile ) {
-            return DVDOpenVOBUDF( dvd, titlenum, 0 );
-        } else {
-            return DVDOpenVOBPath( dvd, titlenum, 0 );
-        }
-        break;
-    default:
-        fprintf( stderr, "libdvdread: Invalid domain for file open.\n" );
-        return 0;
-    }
-    
-    if( dvd->isImageFile ) {
-        return DVDOpenFileUDF( dvd, filename );
-    } else {
-        return DVDOpenFilePath( dvd, filename );
-    }
-}
-
-void DVDCloseFile( dvd_file_t *dvd_file )
-{
-    int i;
-
-    if( dvd_file ) {
-        if( !dvd_file->dvd->isImageFile ) {
-            for( i = 0; i < 9; ++i ) {
-                if( dvd_file->title_devs[ i ] ) {
-                    pf_dvd_close( dvd_file->title_devs[i] );
-                }
-            }
-        }
-
-        free( dvd_file );
-        dvd_file = 0;
-    }
-}
-
-int64_t DVDReadLBUDF( dvd_reader_t *device, uint32_t lb_number,
-                      size_t block_count, unsigned char *data, 
-                      int encrypted )
-{
-    int ret;
-
-    if( !device->dev ) {
-        fprintf( stderr, "libdvdread: Fatal error in block read.\n" );
-        return 0;
-    }
-
-    ret = pf_dvd_seek( device->dev, (int) lb_number, DVDCSS_NOFLAGS );
-    if( ret != (int) lb_number ) {
-        fprintf( stderr, "libdvdread: Can't seek to block %u\n", 
-                         lb_number );
-        return 0;
-    }
-
-    return (int64_t) ( pf_dvd_read( device->dev, (char *) data, 
-                           (int) block_count, encrypted ) 
-                  * (uint64_t) DVD_VIDEO_LB_LEN );
-}
-
-static int64_t DVDReadBlocksUDF( dvd_file_t *dvd_file, uint32_t offset,
-                                 size_t block_count, unsigned char *data )
-{
-    return DVDReadLBUDF( dvd_file->dvd, dvd_file->lb_start + offset,
-                         block_count, data, DVDCSS_READ_DECRYPT );
-}
-
-static int64_t DVDReadBlocksPath( dvd_file_t *dvd_file, size_t offset,
-                                  size_t block_count, unsigned char *data )
-{
-    int i;
-    ssize_t ret, ret2;
-    off64_t off;
-
-    ret = 0;
-    ret2 = 0;
-    for( i = 0; i < 9; ++i ) {
-        if( !dvd_file->title_sizes[ i ] ) return 0;
-
-        if( offset < dvd_file->title_sizes[ i ] ) {
-            if( ( offset + block_count ) <= dvd_file->title_sizes[ i ] ) {
-                off = pf_dvd_seek( dvd_file->title_devs[ i ], (int)offset, 0 );
-                if( off != (int)offset ) {
-                    fprintf( stderr, "libdvdread: Can't seek to block %d\n", 
-                                     offset );
-                    return 0;
-                }
-                ret = pf_dvd_read( dvd_file->title_devs[ i ], data,
-                                   (int)block_count, DVDCSS_READ_DECRYPT );
-                break;
-            } else {
-                size_t part1_size = dvd_file->title_sizes[ i ] - offset;
-                /* FIXME: Really needs to be a while loop.
-                 * (This is only true if you try and read >1GB at a time) */
-
-                /* Read part 1 */
-                off = pf_dvd_seek( dvd_file->title_devs[ i ], offset, 0 );
-                if( off != offset ) {
-                    fprintf( stderr, "libdvdread: Can't seek to block %d\n", 
-                                     offset );
-                    return 0;
-                }
-                ret = pf_dvd_read( dvd_file->title_devs[ i ], data,
-                                   part1_size, DVDCSS_READ_DECRYPT );
-                if( ret < 0 ) return ret;
-                /* FIXME: This is wrong if i is the last file in the set. 
-                 * also error from this read will not show in ret. */
-
-                /* Read part 2 */
-                pf_dvd_seek( dvd_file->title_devs[ i + 1 ], 0, 0 );
-                ret2 = pf_dvd_read( dvd_file->title_devs[ i + 1 ], data +
-                                    ( part1_size * (int64_t)DVD_VIDEO_LB_LEN ),
-                                    block_count - part1_size,
-                                    DVDCSS_READ_DECRYPT );
-                if( ret2 < 0 ) return ret2;
-                break;
-            }
-        } else {
-            offset -= dvd_file->title_sizes[ i ];
-        }
-    }
-
-    return ( (int64_t) ret + (int64_t) ret2 ) * DVD_VIDEO_LB_LEN;
-}
-
-/* These are broken for some cases reading more than 2Gb at a time. */
-ssize_t DVDReadBlocks( dvd_file_t *dvd_file, int offset, 
-                       size_t block_count, unsigned char *data )
-{
-    int64_t ret;
-  
-    if( dvd_file->dvd->isImageFile ) {
-        ret = DVDReadBlocksUDF( dvd_file, (uint32_t)offset, 
-                                block_count, data );
-    } else {
-        ret = DVDReadBlocksPath( dvd_file, (size_t) offset, 
-                                 block_count, data );
-    }
-    if( ret <= 0 ) {
-        return (ssize_t) ret;
-    }
-
-    {
-      ssize_t sret = (ssize_t) (ret / (int64_t)DVD_VIDEO_LB_LEN );
-      if( sret == 0 ) {
-        fprintf(stderr, "libdvdread: DVDReadBlocks got %d bytes\n", (int)ret );
-      }
-      return sret;
-    }
-}
-
-int32_t DVDFileSeek( dvd_file_t *dvd_file, int32_t offset )
-{
-    if( dvd_file->dvd->isImageFile ) {
-        dvd_file->seek_pos = (uint32_t) offset;
-        return offset;
-    } else {
-        return (int32_t) ( lseek( dvd_file->title_devs[0]->i_fd,
-                            (off_t)offset, SEEK_SET ) );
-    }
-}
-
-static ssize_t DVDReadBytesUDF( dvd_file_t *dvd_file, void *data, 
-                                size_t byte_size )
-{
-    unsigned char *secbuf;
-    unsigned int numsec, seek_sector, seek_byte;
-    int64_t len;
-    
-    seek_sector = dvd_file->seek_pos / DVD_VIDEO_LB_LEN;
-    seek_byte   = dvd_file->seek_pos % DVD_VIDEO_LB_LEN;
-
-    numsec = ( ( seek_byte + byte_size ) / DVD_VIDEO_LB_LEN ) + 1;
-    secbuf = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN );
-    if( !secbuf ) {
-        fprintf( stderr, "libdvdread: Can't allocate memory " 
-                         "for file read!\n" );
-        return 0;
-    }
-
-    len = DVDReadLBUDF( dvd_file->dvd, dvd_file->lb_start + seek_sector,
-                        numsec, secbuf, DVDCSS_NOFLAGS );
-    if( len != numsec * (int64_t) DVD_VIDEO_LB_LEN ) {
-        free( secbuf );
-        return 0;
-    }
-
-    dvd_file->seek_pos += byte_size;
-
-    memcpy( data, &(secbuf[ seek_byte ]), byte_size );
-    free( secbuf );
-
-    return byte_size;
-}
-
-static ssize_t DVDReadBytesPath( dvd_file_t *dvd_file, void *data, 
-                                 size_t byte_size )
-{
-    return read( dvd_file->title_devs[0]->i_fd, data, byte_size );
-}
-
-ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
-{
-    if( dvd_file->dvd->isImageFile ) {
-        return DVDReadBytesUDF( dvd_file, data, byte_size );
-    } else {
-        return DVDReadBytesPath( dvd_file, data, byte_size );
-    }
-}
-
-ssize_t DVDFileSize( dvd_file_t *dvd_file )
-{
-    return dvd_file->filesize;
-}
-
-int64_t DVDReadVLBUDF( dvd_reader_t *device, uint32_t lb_number,
-               size_t block_count, struct iovec * vector, int encrypted )
-{
-    int ret;
-
-    if( !device->dev ) {
-        fprintf( stderr, "libdvdread: Fatal error in block read.\n" );
-        return 0;
-    }
-
-    ret = pf_dvd_seek( device->dev, (int) lb_number, 0 );
-    if( ret != (int) lb_number ) {
-        fprintf( stderr, "libdvdread: Can't seek to block %u\n",
-                 lb_number );
-        return 0;
-    }
-
-    return (int64_t) ( pf_dvd_readv( device->dev, vector,
-                                     (int)block_count, encrypted )
-         * (uint64_t) DVD_VIDEO_LB_LEN );
-}
-
-static int64_t DVDReadVBlocksUDF( dvd_file_t *dvd_file, uint32_t offset,
-                 size_t block_count, struct iovec *vector )
-{
-    return DVDReadVLBUDF( dvd_file->dvd, dvd_file->lb_start + offset,
-                         block_count, vector, DVDCSS_READ_DECRYPT );
-}
-
-static int64_t DVDReadVBlocksPath( dvd_file_t *dvd_file, size_t offset,
-                                   size_t block_count, struct iovec *vector )
-{
-    int i;
-    int ret, ret2;
-    int off;
-
-    ret = 0;
-    ret2 = 0;
-    for( i = 0 ; i < 9 ; ++i ) {
-        if( !dvd_file->title_sizes[ i ] ) {
-            return 0;
-        }
-
-        if( offset < dvd_file->title_sizes[ i ] ) {
-            if( ( offset + block_count ) <= dvd_file->title_sizes[ i ] ) {
-                off = pf_dvd_seek( dvd_file->title_devs[ i ],
-                                   (int)offset, 0 );
-                if( off != (int)offset ) {
-                    fprintf( stderr, "libdvdread: Can't seek to block %d\n", 
-                                     offset );
-                    return 0;
-                }
-                ret = pf_dvd_readv( dvd_file->title_devs[ i ], vector,
-                            (int)block_count, DVDCSS_READ_DECRYPT );
-                break;
-            } else {
-                int part1_size = dvd_file->title_sizes[ i ] - offset;
-                /* FIXME: Really needs to be a while loop.
-                 * (This is only true if you try and read >1GB at a time) */
-
-                /* Read part 1 */
-                off = pf_dvd_seek( dvd_file->title_devs[ i ], offset, 0 );
-                if( off != offset ) {
-                    fprintf( stderr, "libdvdread: Can't seek to block %d\n", 
-                                     offset );
-                    return 0;
-                }
-                ret = pf_dvd_readv( dvd_file->title_devs[ i ], vector,
-                                    part1_size, DVDCSS_READ_DECRYPT );
-                
-                if( ret < 0 ) return ret;
-                /* FIXME: This is wrong if i is the last file in the set. 
-                 * also error from this read will not show in ret. */
-
-                /* Read part 2 */
-                pf_dvd_seek( dvd_file->title_devs[ i + 1 ], 0, 0 );
-                ret2 = pf_dvd_readv( dvd_file->title_devs[ i + 1 ],
-                                     vector + part1_size,
-                                     (int)(block_count - part1_size),
-                                     DVDCSS_READ_DECRYPT );
-                if( ret2 < 0 ) return ret2;
-                break;
-            }
-        } else {
-            offset -= dvd_file->title_sizes[ i ];
-        }
-    }
-
-    return ( ret + ret2 ) * (int64_t) DVD_VIDEO_LB_LEN;
-}
-
-
-ssize_t DVDReadVBlocks( dvd_file_t *dvd_file, int offset,
-                        size_t block_count, struct iovec * vector )
-{
-    int64_t ret;
-
-    if( dvd_file->dvd->isImageFile ) {
-        ret = DVDReadVBlocksUDF( dvd_file, (uint32_t)offset,
-                                 block_count, vector );
-    } else {
-        ret = DVDReadVBlocksPath( dvd_file, (size_t) offset, 
-                                  block_count, vector );
-    }
-    if( ret <= 0 ) {
-        return (ssize_t) ret;
-    }
-    
-    {
-      ssize_t sret = (ssize_t) (ret / (int64_t)DVD_VIDEO_LB_LEN );
-      if( sret == 0 )
-      {
-        fprintf(stderr, "libdvdread: DVDReadVBlocks got %d bytes\n", (int)ret );
-      }
-      return sret;
-    }
-}
-
diff --git a/extras/libdvdread/dvd_reader.h b/extras/libdvdread/dvd_reader.h
deleted file mode 100644 (file)
index faaf1c6..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Copyright (C) 2001 Billy Biggs <vektor@dumbterm.net>,
- *                    Håkan Hjort <d95hjort@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., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef DVD_READER_H_INCLUDED
-#define DVD_READER_H_INCLUDED
-
-#include <sys/types.h>
-#include <inttypes.h>
-
-/**
- * The length of one Logical Block of a DVD Video.
- */
-#define DVD_VIDEO_LB_LEN 2048
-
-/**
- * Maximum length of filenames for UDF.
- */
-#define MAX_UDF_FILE_NAME_LEN 2048
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct dvd_reader_s dvd_reader_t;
-typedef struct dvd_file_s dvd_file_t;
-
-/**
- * Opens a block device of a DVD-ROM file, or an image file, or a directory
- * name for a mounted DVD or HD copy of a DVD.  Returns 0 if we can't get any
- * of those methods to work.
- *
- * If the given file is a block device, or is the mountpoint for a block
- * device, then that device is used for CSS authentication using libdvdcss.
- * If no device is available, then no CSS authentication is performed, 
- * and we hope that the image is decrypted.
- *
- * If the path given is a directory, then the files in that directory may be in
- * any one of these formats:
- *
- *   path/VIDEO_TS/VTS_01_1.VOB
- *   path/video_ts/vts_01_1.vob
- *   path/VTS_01_1.VOB
- *   path/vts_01_1.vob
- */
-dvd_reader_t *DVDOpen( const char *path );
-
-/**
- * Closes and cleans up the DVD reader object.  You must close all open files
- * before calling this function.
- */
-void DVDClose( dvd_reader_t *dvd );
-
-/**
- * INFO_FILE       : VIDEO_TS.IFO     (manager)
- *                   VTS_XX_0.IFO     (title)
- *
- * INFO_BACKUP_FILE: VIDEO_TS.BUP     (manager)
- *                   VTS_XX_0.BUP     (title)
- *
- * MENU_VOBS       : VIDEO_TS.VOB     (manager)
- *                   VTS_XX_0.VOB     (title)
- *
- * TITLE_VOBS      : VTS_XX_[1-9].VOB (title)
- *                   All files in the title set are opened and read as a single
- *                   file.
- */
-typedef enum {
-    DVD_READ_INFO_FILE,
-    DVD_READ_INFO_BACKUP_FILE,
-    DVD_READ_MENU_VOBS,
-    DVD_READ_TITLE_VOBS
-} dvd_read_domain_t;
-
-/**
- * Opens a file on the DVD given the title number and domain.  If the title
- * number is 0, the video manager information is opened
- * (VIDEO_TS.[IFO,BUP,VOB]).  Returns a file structure which may be used for
- * reads, or 0 if the file was not found.
- */
-dvd_file_t *DVDOpenFile( dvd_reader_t *dvd, int titlenum, 
-                        dvd_read_domain_t domain );
-
-/**
- * Closes a file and frees the associated structure.
- */
-void DVDCloseFile( dvd_file_t *dvd_file );
-
-/**
- * Reads block_count number of blocks from the file at the given block offset.
- * Returns number of blocks read on success, -1 on error.  This call is only
- * for reading VOB data, and should not be used when reading the IFO files.  
- * When reading from an encrypted drive, blocks are decrypted using libdvdcss 
- * where required.
- */
-ssize_t DVDReadBlocks( dvd_file_t *dvd_file, int offset,
-                      size_t block_count, unsigned char *data );
-
-/**
- * The same calling a readv-like function to fill a struct iovec.
- */
-struct iovec;
-ssize_t DVDReadVBlocks( dvd_file_t *dvd_file, int offset,
-                       size_t block_count, struct iovec * vector );
-/**
- * Seek to the given position in the file.  Returns the resulting position in
- * bytes from the beginning of the file.  The seek position is only used for
- * byte reads from the file, the block read call always reads from the given
- * offset.
- */
-int DVDFileSeek( dvd_file_t *dvd_file, int offset );
-
-/**
- * Reads the given number of bytes from the file.  This call can only be used
- * on the information files, and may not be used for reading from a VOB.  This
- * reads from and increments the currrent seek position for the file.
- */
-ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size );
-
-/**
- * Returns the file size in blocks.
- */
-ssize_t DVDFileSize( dvd_file_t *dvd_file );
-
-#ifdef __cplusplus
-};
-#endif
-#endif /* DVD_READER_H_INCLUDED */
diff --git a/extras/libdvdread/dvd_setup.c b/extras/libdvdread/dvd_setup.c
deleted file mode 100644 (file)
index cd05af8..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/**
- * dvd_setup.c: setup read functions with either libdvdcss
- * or minimal DVD access.
- */
-
-/**
- * Copyright (C) 2001 VideoLAN
- * $Id: dvd_setup.c,v 1.2 2002/01/23 03:56:51 stef Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * 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, USA.
- */
-
-/**
- * Preamble
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dlfcn.h>
-#include <sys/uio.h>                                        /* struct iovec */
-
-#include "dvd_reader.h"
-#include "dvd_setup.h"
-
-#ifdef GOD_DAMN_DMCA
-/**
- * dvd_open: initialize library, open a DVD device.
- */
-static dvd_handle dvd_open ( char *psz_target )
-{
-    dvd_handle dev;
-
-    /* Allocate the library structure */
-    dev = malloc( sizeof( dvd_handle ) );
-    if( dev == NULL )
-    {
-        fprintf( stderr, "libdvdread: Could not allocate memory.\n" );
-        return NULL;
-    }
-
-    /* Open the device */
-    dev->i_fd = open( psz_target, 0 );
-    if( dev->i_fd < 0 )
-    {
-        fprintf( stderr, "libdvdread: Could not open device.\n" );
-        free( dev );
-        return NULL;
-    }
-
-    return dev;
-}
-
-/**
- * dvd_error: return the last error message
- */
-static char * dvd_error ( dvd_handle dev )
-{
-    return "unknown error";
-}
-
-/**
- * dvd_seek: seek into the device.
- */
-static int dvd_seek ( dvd_handle dev, int i_blocks, int i_flags )
-{
-    off_t i_read;
-
-    i_read = lseek( dev->i_fd,
-                    (off_t)i_blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET );
-
-    return i_read / DVD_VIDEO_LB_LEN;
-}
-
-/**
- * dvd_read: read data from the device.
- */
-static int dvd_read ( dvd_handle dev, void *p_buffer,
-                      int i_blocks,
-                      int i_flags )
-{
-    int i_bytes;
-
-    i_bytes = read( dev->i_fd, p_buffer,
-                    (size_t)i_blocks * DVD_VIDEO_LB_LEN );
-
-    return i_bytes / DVD_VIDEO_LB_LEN;
-}
-
-/**
- * dvd_readv: read data to an iovec structure.
- */
-static int dvd_readv ( dvd_handle dev, void *p_iovec,
-                       int i_blocks,
-                       int i_flags )
-{
-    int i_read;
-
-    i_read = readv( dev->i_fd, (struct iovec*)p_iovec, i_blocks );
-
-    return i_read / DVD_VIDEO_LB_LEN;
-}
-
-/**
- * dvd_close: close the DVD device and clean up the library.
- */
-static int dvd_close ( dvd_handle dev )
-{
-    int i_ret;
-
-    i_ret = close( dev->i_fd );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    free( dev );
-
-    return 0;
-}
-
-void DVDSetupRead( void )
-{
-    void * dvdcss_library = NULL;
-
-    if( ( dvdcss_library = dlopen( "libdvdcss.so.1", RTLD_LAZY ) ) )
-    {
-        pf_dvd_open = dlsym( dvdcss_library, "dvdcss_open" );
-        pf_dvd_close = dlsym( dvdcss_library, "dvdcss_close" );
-        pf_dvd_seek = dlsym( dvdcss_library, "dvdcss_seek" );
-        pf_dvd_read = dlsym( dvdcss_library, "dvdcss_read" );
-        pf_dvd_readv = dlsym( dvdcss_library, "dvdcss_readv" );
-        pf_dvd_error = dlsym( dvdcss_library, "dvdcss_error" );
-
-        if( pf_dvd_open == NULL || pf_dvd_close == NULL
-             || pf_dvd_seek == NULL || pf_dvd_read == NULL
-             || pf_dvd_readv == NULL || pf_dvd_error == NULL )
-        {
-            fprintf( stderr,  "libdvdread: Missing symbols in libdvdcss.so.1, "
-                              "this shouldn't happen !" );
-            dlclose( dvdcss_library );
-            dvdcss_library = NULL;
-        }
-        else
-        {
-            printf( "libdvdread: Using libdvdcss.so.1 for DVD access\n" );
-        }
-    }
-    else
-    {
-        fprintf( stderr, "libdvdread: Can't open libdvdcss.so.1: %s.\n",
-                 dlerror() );
-    }
-    
-    if( !dvdcss_library )
-    {
-        /* Replacement functions */
-        pf_dvd_open = dvd_open;
-        pf_dvd_close = dvd_close;
-        pf_dvd_seek = dvd_seek;
-        pf_dvd_read = dvd_read;
-        pf_dvd_readv = dvd_readv;
-        pf_dvd_error = dvd_error;
-    }
-}
-#else
-void DVDSetupRead( void )
-{   
-    pf_dvd_open = dvdcss_open;
-    pf_dvd_close = dvdcss_close;
-    pf_dvd_seek = dvdcss_seek;
-    pf_dvd_read = dvdcss_read;
-    pf_dvd_readv = dvdcss_readv;
-    pf_dvd_error = dvdcss_error;
-}
-#endif
diff --git a/extras/libdvdread/dvd_setup.h b/extras/libdvdread/dvd_setup.h
deleted file mode 100644 (file)
index f565ea8..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * dvd_setup.h: setup functions header.
- */
-
-/* Copyright (C) 2001 VideoLAN
- * $Id: dvd_setup.h,v 1.2 2002/01/23 03:56:51 stef Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * 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, USA.
- */
-
-/**
- * The libdvdcss structure.
- */
-struct dvdcss_s
-{
-    /* File descriptor */
-    int i_fd;
-};
-
-#ifdef GOD_DAMN_DMCA
-/**
- * Defines and flags.
- */
-#  define DVDCSS_NOFLAGS         0
-#  define DVDCSS_READ_DECRYPT    (1 << 0)
-#  define DVDCSS_SEEK_MPEG       (1 << 0)
-#  define DVDCSS_SEEK_KEY        (1 << 1)
-
-#else
-#  include <videolan/dvdcss.h>
-#endif
-
-typedef struct dvdcss_s* dvd_handle;
-
-/**
- * Pointers which will be filled either with dummy functions or
- * with the dlopen()ed ones.
- */
-dvd_handle (*pf_dvd_open)  ( char * );
-int        (*pf_dvd_close) ( dvd_handle );
-int        (*pf_dvd_seek)  ( dvd_handle, int, int );
-int        (*pf_dvd_read)  ( dvd_handle, void *, int, int );
-int        (*pf_dvd_readv) ( dvd_handle, void *, int, int );
-char *     (*pf_dvd_error) ( dvd_handle );
-
-/**
- * Setup function accessed by dvd_reader.c
- */
-void DVDSetupRead( void );
diff --git a/extras/libdvdread/dvd_udf.c b/extras/libdvdread/dvd_udf.c
deleted file mode 100644 (file)
index e3ec623..0000000
+++ /dev/null
@@ -1,466 +0,0 @@
-/**
- * This code is based on dvdudf by:
- *   Christian Wolff <scarabaeus@convergence.de>.
- *
- * Modifications by:
- *   Billy Biggs <vektor@dumbterm.net>.
- *
- * dvdudf: parse and read the UDF volume information of a DVD Video
- * Copyright (C) 1999 Christian Wolff for convergence integrated media
- * GmbH The author can be reached at scarabaeus@convergence.de, the
- * project's page is at http://linuxtv.org/dvd/
- * 
- * 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.  Or, point your browser to
- * http://www.gnu.org/copyleft/gpl.html
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <inttypes.h>
-
-#include "dvd_udf.h"
-
-extern int64_t DVDReadLBUDF( dvd_reader_t *device, uint32_t lb_number,
-                            size_t block_count, unsigned char *data, 
-                            int encrypted );
-
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-
-struct Partition {
-    int valid;
-    char VolumeDesc[128];
-    uint16_t Flags;
-    uint16_t Number;
-    char Contents[32];
-    uint32_t AccessType;
-    uint32_t Start;
-    uint32_t Length;
-};
-
-struct AD {
-    uint32_t Location;
-    uint32_t Length;
-    uint8_t  Flags;
-    uint16_t Partition;
-};
-
-/* For direct data access, LSB first */
-#define GETN1(p) ((uint8_t)data[p])
-#define GETN2(p) ((uint16_t)data[p] | ((uint16_t)data[(p) + 1] << 8))
-#define GETN3(p) ((uint32_t)data[p] | ((uint32_t)data[(p) + 1] << 8) \
-                 | ((uint32_t)data[(p) + 2] << 16))
-#define GETN4(p) ((uint32_t)data[p] \
-                 | ((uint32_t)data[(p) + 1] << 8) \
-                 | ((uint32_t)data[(p) + 2] << 16) \
-                 | ((uint32_t)data[(p) + 3] << 24))
-/* This is wrong with regard to endianess */
-#define GETN(p, n, target) memcpy(target, &data[p], n)
-
-static int Unicodedecode( uint8_t *data, int len, char *target ) 
-{
-    int p = 1, i = 0;
-
-    if( ( data[ 0 ] == 8 ) || ( data[ 0 ] == 16 ) ) do {
-        if( data[ 0 ] == 16 ) p++;  /* Ignore MSB of unicode16 */
-        if( p < len ) {
-            target[ i++ ] = data[ p++ ];
-        }
-    } while( p < len );
-
-    target[ i ] = '\0';
-    return 0;
-}
-
-static int UDFDescriptor( uint8_t *data, uint16_t *TagID ) 
-{
-    *TagID = GETN2(0);
-    // TODO: check CRC 'n stuff
-    return 0;
-}
-
-static int UDFExtentAD( uint8_t *data, uint32_t *Length, uint32_t *Location ) 
-{
-    *Length   = GETN4(0);
-    *Location = GETN4(4);
-    return 0;
-}
-
-static int UDFShortAD( uint8_t *data, struct AD *ad, 
-                      struct Partition *partition ) 
-{
-    ad->Length = GETN4(0);
-    ad->Flags = ad->Length >> 30;
-    ad->Length &= 0x3FFFFFFF;
-    ad->Location = GETN4(4);
-    ad->Partition = partition->Number; // use number of current partition
-    return 0;
-}
-
-static int UDFLongAD( uint8_t *data, struct AD *ad )
-{
-    ad->Length = GETN4(0);
-    ad->Flags = ad->Length >> 30;
-    ad->Length &= 0x3FFFFFFF;
-    ad->Location = GETN4(4);
-    ad->Partition = GETN2(8);
-    //GETN(10, 6, Use);
-    return 0;
-}
-
-static int UDFExtAD( uint8_t *data, struct AD *ad )
-{
-    ad->Length = GETN4(0);
-    ad->Flags = ad->Length >> 30;
-    ad->Length &= 0x3FFFFFFF;
-    ad->Location = GETN4(12);
-    ad->Partition = GETN2(16);
-    //GETN(10, 6, Use);
-    return 0;
-}
-
-static int UDFICB( uint8_t *data, uint8_t *FileType, uint16_t *Flags )
-{
-    *FileType = GETN1(11);
-    *Flags = GETN2(18);
-    return 0;
-}
-
-
-static int UDFPartition( uint8_t *data, uint16_t *Flags, uint16_t *Number,
-                        char *Contents, uint32_t *Start, uint32_t *Length )
-{
-    *Flags = GETN2(20);
-    *Number = GETN2(22);
-    GETN(24, 32, Contents);
-    *Start = GETN4(188);
-    *Length = GETN4(192);
-    return 0;
-}
-
-/**
- * Reads the volume descriptor and checks the parameters.  Returns 0 on OK, 1
- * on error.
- */
-static int UDFLogVolume( uint8_t *data, char *VolumeDescriptor )
-{
-    uint32_t lbsize, MT_L, N_PM;
-    Unicodedecode(&data[84], 128, VolumeDescriptor);
-    lbsize = GETN4(212);  // should be 2048
-    MT_L = GETN4(264);    // should be 6
-    N_PM = GETN4(268);    // should be 1
-    if (lbsize != DVD_VIDEO_LB_LEN) return 1;
-    return 0;
-}
-
-static int UDFFileEntry( uint8_t *data, uint8_t *FileType, 
-                        struct Partition *partition, struct AD *ad )
-{
-    uint16_t flags;
-    uint32_t L_EA, L_AD;
-    unsigned int p;
-
-    UDFICB( &data[ 16 ], FileType, &flags );
-   
-    /* Init ad for an empty file (i.e. there isn't a AD, L_AD == 0 ) */
-    ad->Length = GETN4( 60 ); // Really 8 bytes a 56
-    ad->Flags = 0;
-    ad->Location = 0; // what should we put here? 
-    ad->Partition = partition->Number; // use number of current partition
-
-    L_EA = GETN4( 168 );
-    L_AD = GETN4( 172 );
-    p = 176 + L_EA;
-    while( p < 176 + L_EA + L_AD ) {
-        switch( flags & 0x0007 ) {
-            case 0: UDFShortAD( &data[ p ], ad, partition ); p += 8;  break;
-            case 1: UDFLongAD( &data[ p ], ad );  p += 16; break;
-            case 2: UDFExtAD( &data[ p ], ad );   p += 20; break;
-            case 3:
-                switch( L_AD ) {
-                    case 8:  UDFShortAD( &data[ p ], ad, partition ); break;
-                    case 16: UDFLongAD( &data[ p ], ad );  break;
-                    case 20: UDFExtAD( &data[ p ], ad );   break;
-                }
-                p += L_AD;
-                break;
-            default:
-                p += L_AD; break;
-        }
-    }
-    return 0;
-}
-
-static int UDFFileIdentifier( uint8_t *data, uint8_t *FileCharacteristics,
-                             char *FileName, struct AD *FileICB )
-{
-    uint8_t L_FI;
-    uint16_t L_IU;
-
-    *FileCharacteristics = GETN1(18);
-    L_FI = GETN1(19);
-    UDFLongAD(&data[20], FileICB);
-    L_IU = GETN2(36);
-    if (L_FI) Unicodedecode(&data[38 + L_IU], L_FI, FileName);
-    else FileName[0] = '\0';
-    return 4 * ((38 + L_FI + L_IU + 3) / 4);
-}
-
-/**
- * Maps ICB to FileAD
- * ICB: Location of ICB of directory to scan
- * FileType: Type of the file
- * File: Location of file the ICB is pointing to
- * return 1 on success, 0 on error;
- */
-static int UDFMapICB( dvd_reader_t *device, struct AD ICB, uint8_t *FileType,
-                     struct Partition *partition, struct AD *File ) 
-{
-    uint8_t LogBlock[DVD_VIDEO_LB_LEN];
-    uint32_t lbnum;
-    uint16_t TagID;
-
-    lbnum = partition->Start + ICB.Location;
-    do {
-        if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) {
-            TagID = 0;
-        } else {
-            UDFDescriptor( LogBlock, &TagID );
-        }
-
-        if( TagID == 261 ) {
-            UDFFileEntry( LogBlock, FileType, partition, File );
-            return 1;
-        };
-    } while( ( lbnum <= partition->Start + ICB.Location + ( ICB.Length - 1 )
-             / DVD_VIDEO_LB_LEN ) && ( TagID != 261 ) );
-
-    return 0;
-}
-
-/**
- * Dir: Location of directory to scan
- * FileName: Name of file to look for
- * FileICB: Location of ICB of the found file
- * return 1 on success, 0 on error;
- */
-static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName,
-                       struct Partition *partition, struct AD *FileICB ) 
-{
-    char filename[ MAX_UDF_FILE_NAME_LEN ];
-    uint8_t directory[ 2 * DVD_VIDEO_LB_LEN ];
-    uint32_t lbnum;
-    uint16_t TagID;
-    uint8_t filechar;
-    unsigned int p;
-
-    /* Scan dir for ICB of file */
-    lbnum = partition->Start + Dir.Location;
-
-    if( DVDReadLBUDF( device, lbnum, 2, directory, 0 ) <= 0 ) {
-        return 0;
-    }
-
-    p = 0;
-    while( p < Dir.Length ) {
-        if( p > DVD_VIDEO_LB_LEN ) {
-            ++lbnum;
-            p -= DVD_VIDEO_LB_LEN;
-            Dir.Length -= DVD_VIDEO_LB_LEN;
-            if( DVDReadLBUDF( device, lbnum, 2, directory, 0 ) <= 0 ) {
-                return 0;
-            }
-        }
-        UDFDescriptor( &directory[ p ], &TagID );
-        if( TagID == 257 ) {
-            p += UDFFileIdentifier( &directory[ p ], &filechar,
-                                    filename, FileICB );
-            if( !strcasecmp( FileName, filename ) ) {
-                return 1;
-            }
-        } else {
-            return 0;
-        }
-    }
-
-    return 0;
-}
-
-/**
- * Looks for partition on the disc.  Returns 1 if partition found, 0 on error.
- *   partnum: Number of the partition, starting at 0.
- *   part: structure to fill with the partition information
- */
-static int UDFFindPartition( dvd_reader_t *device, int partnum,
-                            struct Partition *part ) 
-{
-    uint8_t LogBlock[ DVD_VIDEO_LB_LEN ], Anchor[ DVD_VIDEO_LB_LEN ];
-    uint32_t lbnum, MVDS_location, MVDS_length;
-    uint16_t TagID;
-    uint32_t lastsector;
-    int i, terminate, volvalid;
-
-    /* Find Anchor */
-    lastsector = 0;
-    lbnum = 256;   /* Try #1, prime anchor */
-    terminate = 0;
-
-    for(;;) {
-        if( DVDReadLBUDF( device, lbnum, 1, Anchor, 0 ) > 0 ) {
-            UDFDescriptor( Anchor, &TagID );
-        } else {
-            TagID = 0;
-        }
-        if (TagID != 2) {
-            /* Not an anchor */
-            if( terminate ) return 0; /* Final try failed */
-
-            if( lastsector ) {
-
-                /* We already found the last sector.  Try #3, alternative
-                 * backup anchor.  If that fails, don't try again.
-                 */
-                lbnum = lastsector;
-                terminate = 1;
-            } else {
-                /* TODO: Find last sector of the disc (this is optional). */
-                if( lastsector ) {
-                    /* Try #2, backup anchor */
-                    lbnum = lastsector - 256;
-                } else {
-                    /* Unable to find last sector */
-                    return 0;
-                }
-            }
-        } else {
-            /* It's an anchor! We can leave */
-            break;
-        }
-    }
-    /* Main volume descriptor */
-    UDFExtentAD( &Anchor[ 16 ], &MVDS_length, &MVDS_location );
-       
-    part->valid = 0;
-    volvalid = 0;
-    part->VolumeDesc[ 0 ] = '\0';
-    i = 1;
-    do {
-        /* Find Volume Descriptor */
-        lbnum = MVDS_location;
-        do {
-
-            if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) {
-                TagID = 0;
-            } else {
-                UDFDescriptor( LogBlock, &TagID );
-            }
-
-            if( ( TagID == 5 ) && ( !part->valid ) ) {
-                /* Partition Descriptor */
-                UDFPartition( LogBlock, &part->Flags, &part->Number,
-                              part->Contents, &part->Start, &part->Length );
-                part->valid = ( partnum == part->Number );
-            } else if( ( TagID == 6 ) && ( !volvalid ) ) {
-                /* Logical Volume Descriptor */
-                if( UDFLogVolume( LogBlock, part->VolumeDesc ) ) {  
-                    /* TODO: sector size wrong! */
-                } else {
-                    volvalid = 1;
-                }
-            }
-
-        } while( ( lbnum <= MVDS_location + ( MVDS_length - 1 )
-                 / DVD_VIDEO_LB_LEN ) && ( TagID != 8 )
-                 && ( ( !part->valid ) || ( !volvalid ) ) );
-
-        if( ( !part->valid) || ( !volvalid ) ) {
-            /* Backup volume descriptor */
-            UDFExtentAD( &Anchor[ 24 ], &MVDS_length, &MVDS_location );
-        }
-    } while( i-- && ( ( !part->valid ) || ( !volvalid ) ) );
-
-    /* We only care for the partition, not the volume */
-    return part->valid;
-}
-
-uint32_t UDFFindFile( dvd_reader_t *device, char *filename,
-                     uint32_t *filesize )
-{
-    uint8_t LogBlock[ DVD_VIDEO_LB_LEN ];
-    uint32_t lbnum;
-    uint16_t TagID;
-    struct Partition partition;
-    struct AD RootICB, File, ICB;
-    char tokenline[ MAX_UDF_FILE_NAME_LEN ];
-    char *token;
-    uint8_t filetype;
-       
-    *filesize = 0;
-    tokenline[0] = '\0';
-    strcat( tokenline, filename );
-
-    /* Find partition, 0 is the standard location for DVD Video.*/
-    if( !UDFFindPartition( device, 0, &partition ) ) return 0;
-
-    /* Find root dir ICB */
-    lbnum = partition.Start;
-    do {
-        if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) {
-            TagID = 0;
-        } else {
-            UDFDescriptor( LogBlock, &TagID );
-        }
-
-        /* File Set Descriptor */
-        if( TagID == 256 ) {  // File Set Descriptor
-            UDFLongAD( &LogBlock[ 400 ], &RootICB );
-        }
-    } while( ( lbnum < partition.Start + partition.Length )
-             && ( TagID != 8 ) && ( TagID != 256 ) );
-
-    /* Sanity checks. */
-    if( TagID != 256 ) return 0;
-    if( RootICB.Partition != 0 ) return 0;
-       
-    /* Find root dir */
-    if( !UDFMapICB( device, RootICB, &filetype, &partition, &File ) ) return 0;
-    if( filetype != 4 ) return 0;  /* Root dir should be dir */
-
-    /* Tokenize filepath */
-    token = strtok(tokenline, "/");
-    while( token != NULL ) {
-        if( !UDFScanDir( device, File, token, &partition, &ICB ) ) return 0;
-        if( !UDFMapICB( device, ICB, &filetype, &partition, &File ) ) return 0;
-        token = strtok( NULL, "/" );
-    }
-    
-    /* Sanity check. */
-    if( File.Partition != 0 ) return 0;
-   
-    *filesize = File.Length;
-    /* Hack to not return partition.Start for empty files. */
-    if( !File.Location )
-      return 0;
-    else
-      return partition.Start + File.Location;
-}
diff --git a/extras/libdvdread/dvd_udf.h b/extras/libdvdread/dvd_udf.h
deleted file mode 100644 (file)
index c45bc38..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * This code is based on dvdudf by:
- *   Christian Wolff <scarabaeus@convergence.de>.
- *
- * Modifications by:
- *   Billy Biggs <vektor@dumbterm.net>.
- *
- * dvdudf: parse and read the UDF volume information of a DVD Video
- * Copyright (C) 1999 Christian Wolff for convergence integrated media
- * GmbH The author can be reached at scarabaeus@convergence.de, the
- * project's page is at http://linuxtv.org/dvd/
- * 
- * 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.  Or, point your browser to
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#ifndef DVD_UDF_H_INCLUDED
-#define DVD_UDF_H_INCLUDED
-
-#include "dvd_reader.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Looks for a file on the UDF disc/imagefile and returns the block number
- * where it begins, or 0 if it is not found.  The filename should be an
- * absolute pathname on the UDF filesystem, starting with '/'.  For example,
- * '/VIDEO_TS/VTS_01_1.IFO'.  On success, filesize will be set to the size of
- * the file in bytes.
- */
-uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *size );
-
-#ifdef __cplusplus
-};
-#endif
-#endif /* DVD_UDF_H_INCLUDED */
diff --git a/extras/libdvdread/ifo_print.c b/extras/libdvdread/ifo_print.c
deleted file mode 100644 (file)
index 9b53636..0000000
+++ /dev/null
@@ -1,1044 +0,0 @@
-/* 
- * Copyright (C) 2000 Björn Englund <d4bjorn@dtek.chalmers.se>, 
- *                    Håkan Hjort <d95hjort@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
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include "config.h" // Needed for WORDS_BIGENDIAN
-#include "ifo_types.h"
-#include "ifo_read.h"
-#include "ifo_print.h"
-
-/* Put this in some other file / package?  It's used in nav_print too. */
-static void ifoPrint_time(int level, dvd_time_t *dtime) {
-  const char *rate;
-  assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa);
-  assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
-  assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
-  assert((dtime->frame_u&0xf) < 0xa);
-  
-  printf("%02x:%02x:%02x.%02x", 
-        dtime->hour,
-        dtime->minute,
-        dtime->second,
-        dtime->frame_u & 0x3f);
-  switch((dtime->frame_u & 0xc0) >> 6) {
-  case 1:
-    rate = "25.00";
-    break;
-  case 3:
-    rate = "29.97";
-    break;
-  default:
-    if(dtime->hour == 0 && dtime->minute == 0 
-       && dtime->second == 0 && dtime->frame_u == 0)
-      rate = "no";
-    else
-      rate = "(please send a bug report)";
-    break;
-  } 
-  printf(" @ %s fps", rate);
-}
-
-/* Put this in some other file / package?  It's used in nav_print too.
-   Possibly also by the vm / navigator. */
-static void ifoPrint_CMD(int row, vm_cmd_t *command) {
-  int i;
-
-  printf("(%03d) ", row + 1);
-  for(i=0;i<8;i++)
-    printf("%02x ", command->bytes[i]);
-  printf("| ");
-
-  //vmcmd(command);
-  printf("\n");
-}
-
-static void ifoPrint_video_attributes(int level, video_attr_t *attr) {
-  
-  /* The following test is shorter but not correct ISO C,
-     memcmp(attr,my_friendly_zeros, sizeof(video_attr_t)) */
-  if(attr->mpeg_version == 0 
-     && attr->video_format == 0 
-     && attr->display_aspect_ratio == 0 
-     && attr->permitted_df == 0 
-     && attr->unknown1 == 0 
-     && attr->line21_cc_1 == 0 
-     && attr->line21_cc_2 == 0 
-     && attr->video_format == 0 
-     && attr->letterboxed == 0 
-     && attr->film_mode == 0) {
-    printf("-- Unspecified --");
-    return;
-  }
-  
-  switch(attr->mpeg_version) {
-  case 0:
-    printf("mpeg1 ");
-    break;
-  case 1:
-    printf("mpeg2 ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  switch(attr->video_format) {
-  case 0:
-    printf("ntsc ");
-    break;
-  case 1:
-    printf("pal ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  switch(attr->display_aspect_ratio) {
-  case 0:
-    printf("4:3 ");
-    break;
-  case 3:
-    printf("16:9 ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  // Wide is allways allowed..!!!
-  switch(attr->permitted_df) {
-  case 0:
-    printf("pan&scan+letterboxed ");
-    break;
-  case 1:
-    printf("only pan&scan "); //??
-    break;
-  case 2:
-    printf("only letterboxed ");
-    break;
-  case 3:
-    // not specified
-    break;
-  default:
-    printf("(please send a bug report)");
-  }
-  
-  printf("U%x ", attr->unknown1);
-  assert(!attr->unknown1);
-  
-  if(attr->line21_cc_1 || attr->line21_cc_2) {
-    printf("NTSC CC ");
-    if(attr->line21_cc_1)
-      printf("1 ");
-    if(attr->line21_cc_2)
-      printf("2 ");
-  }
-  
-  {
-    int height = 480;
-    if(attr->video_format != 0) 
-      height = 576;
-    switch(attr->picture_size) {
-    case 0:
-      printf("720x%d ", height);
-      break;
-    case 1:
-      printf("704x%d ", height);
-      break;
-    case 2:
-      printf("352x%d ", height);
-      break;
-    case 3:
-      printf("352x%d ", height/2);
-      break;      
-    default:
-      printf("(please send a bug report) ");
-    }
-  }
-
-  if(attr->letterboxed) {
-    printf("letterboxed ");
-  }
-  
-  if(attr->film_mode) {
-    printf("film");
-  } else {
-    printf("video"); //camera
-  }
-}
-
-static void ifoPrint_audio_attributes(int level, audio_attr_t *attr) {
-  
-  if(attr->audio_format == 0
-     && attr->multichannel_extension == 0
-     && attr->lang_type == 0
-     && attr->application_mode == 0
-     && attr->quantization == 0
-     && attr->sample_frequency == 0
-     && attr->channels == 0
-     && attr->lang_extension == 0
-     && attr->unknown1 == 0
-     && attr->unknown1 == 0) {
-    printf("-- Unspecified --");
-    return;
-  }
-  
-  switch(attr->audio_format) {
-  case 0:
-    printf("ac3 ");
-    break;
-  case 1:
-    printf("(please send a bug report) ");
-    break;
-  case 2:
-    printf("mpeg1 ");
-    break;
-  case 3:
-    printf("mpeg2ext ");
-    break;
-  case 4:
-    printf("lpcm ");
-    break;
-  case 5:
-    printf("(please send a bug report) ");
-    break;
-  case 6:
-    printf("dts ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  if(attr->multichannel_extension)
-    printf("multichannel_extension ");
-  
-  switch(attr->lang_type) {
-  case 0:
-    // not specified
-    assert(attr->lang_code == 0);
-    break;
-  case 1:
-    printf("%c%c ", attr->lang_code>>8, attr->lang_code & 0xff);
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-
-  switch(attr->application_mode) {
-  case 0:
-    // not specified
-    break;
-  case 1:
-    printf("karaoke mode ");
-    break;
-  case 2:
-    printf("surround sound mode ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  switch(attr->quantization) {
-  case 0:
-    printf("16bit ");
-    break;
-  case 1:
-    printf("20bit ");
-    break;
-  case 2:
-    printf("24bit ");
-    break;
-  case 3:
-    printf("drc ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  switch(attr->sample_frequency) {
-  case 0:
-    printf("48kHz ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-  
-  printf("%dCh ", attr->channels + 1);
-  
-  switch(attr->lang_extension) {
-  case 0:
-    printf("Not specified ");
-    break;
-  case 1: // Normal audio
-    printf("Normal Caption ");
-    break;
-  case 2: // visually imparied
-    printf("Audio for visually impaired ");
-    break;
-  case 3: // Directors 1
-    printf("Director's comments 1 ");
-    break;
-  case 4: // Directors 2
-    printf("Director's comments 2 ");
-    break;
-    //case 4: // Music score ?    
-  default:
-    printf("(please send a bug report) ");
-  }
-    
-  printf("%d ", attr->unknown1);
-  printf("%d ", attr->unknown2);
-}
-
-static void ifoPrint_subp_attributes(int level, subp_attr_t *attr) {
-  
-  if(attr->type == 0
-     && attr->lang_code == 0
-     && attr->zero1 == 0
-     && attr->zero2 == 0
-     && attr->lang_extension== 0) {
-    printf("-- Unspecified --");
-    return;
-  }
-  
-  printf("type %02x ", attr->type);
-  
-  if(isalpha((int)(attr->lang_code >> 8))
-     && isalpha((int)(attr->lang_code & 0xff))) {
-    printf("%c%c ", attr->lang_code >> 8, attr->lang_code & 0xff);
-  } else {
-    printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8), 
-          0xff & (unsigned)(attr->lang_code & 0xff));
-  }
-  
-  printf("%d ", attr->zero1);
-  printf("%d ", attr->zero2);
-
-  switch(attr->lang_extension) {
-  case 0:
-    printf("Not specified ");
-    break;
-  case 1:
-    printf("Caption with normal size character ");
-    break;
-  case 2:
-    printf("Caption with bigger size character ");
-    break;
-  case 3: 
-    printf("Caption for children ");
-    break;
-  case 4:
-    printf("reserved ");
-    break;
-  case 5:
-    printf("Closed Caption with normal size character ");
-    break;
-  case 6:
-    printf("Closed Caption with bigger size character ");
-    break;
-  case 7:
-    printf("Closed Caption for children ");
-    break;
-  case 8:
-    printf("reserved ");
-    break;
-  case 9:
-    printf("Forced Caption");
-    break;
-  case 10:
-    printf("reserved ");
-    break;
-  case 11:
-    printf("reserved ");
-    break;
-  case 12:
-    printf("reserved ");
-    break;
-  case 13:
-    printf("Director's comments with normal size character ");
-    break;
-  case 14:
-    printf("Director's comments with bigger size character ");
-    break;
-  case 15:
-    printf("Director's comments for children ");
-    break;
-  default:
-    printf("(please send a bug report) ");
-  }
-
-}
-
-
-void ifoPrint_USER_OPS(user_ops_t *user_ops) {
-  uint32_t uops;
-  unsigned char *ptr = (unsigned char *)user_ops;
-  
-  uops  = (*ptr++ << 24);
-  uops |= (*ptr++ << 16);
-  uops |= (*ptr++ << 8);
-  uops |= (*ptr++);
-  
-  if(uops == 0) {
-    printf("None\n");
-  } else if(uops == 0x01ffffff) {
-    printf("All\n");
-  } else {
-    if(user_ops->title_or_time_play)
-      printf("Title or Time Play, ");
-    if(user_ops->chapter_search_or_play)
-      printf("Chapter Search or Play, ");
-    if(user_ops->title_play)
-      printf("Title Play, ");
-    if(user_ops->stop)
-      printf("Stop, ");
-    if(user_ops->go_up)
-      printf("Go Up, ");
-    if(user_ops->time_or_chapter_search)
-      printf("Time or Chapter Search, ");
-    if(user_ops->prev_or_top_pg_search)
-      printf("Prev or Top PG Search, ");
-    if(user_ops->next_pg_search)
-      printf("Next PG Search, ");
-    if(user_ops->forward_scan)
-      printf("Forward Scan, ");
-    if(user_ops->backward_scan)
-      printf("Backward Scan, ");
-    if(user_ops->title_menu_call)
-      printf("Title Menu Call, ");
-    if(user_ops->root_menu_call)
-      printf("Root Menu Call, ");
-    if(user_ops->subpic_menu_call)
-      printf("SubPic Menu Call, ");
-    if(user_ops->audio_menu_call)
-      printf("Audio Menu Call, ");
-    if(user_ops->angle_menu_call)
-      printf("Angle Menu Call, ");
-    if(user_ops->chapter_menu_call)
-      printf("Chapter Menu Call, ");
-    if(user_ops->resume)
-      printf("Resume, ");
-    if(user_ops->button_select_or_activate)
-      printf("Button Select or Activate, ");
-    if(user_ops->still_off)
-      printf("Still Off, ");
-    if(user_ops->pause_on)
-      printf("Pause On, ");
-    if(user_ops->audio_stream_change)
-      printf("Audio Stream Change, ");
-    if(user_ops->subpic_stream_change)
-      printf("SubPic Stream Change, ");
-    if(user_ops->angle_change)
-      printf("Angle Change, ");
-    if(user_ops->karaoke_audio_pres_mode_change)
-      printf("Karaoke Audio Pres Mode Change, ");
-    if(user_ops->video_pres_mode_change)
-      printf("Video Pres Mode Change, ");
-    printf("\n");
-  }
-}
-
-
-void ifoPrint_VMGI_MAT(vmgi_mat_t *vmgi_mat) {
-  
-  printf("VMG Identifier: %.12s\n", vmgi_mat->vmg_identifier);
-  printf("Last Sector of VMG: %08x\n", vmgi_mat->vmg_last_sector);
-  printf("Last Sector of VMGI: %08x\n", vmgi_mat->vmgi_last_sector);
-  printf("Specification version number: %01x.%01x\n", 
-        vmgi_mat->specification_version >> 4, 
-        vmgi_mat->specification_version & 0xf);
-  /* Byte 2 of 'VMG Category' (00xx0000) is the Region Code */
-  printf("VMG Category: %08x\n", vmgi_mat->vmg_category);
-  printf("VMG Number of Volumes: %i\n", vmgi_mat->vmg_nr_of_volumes);
-  printf("VMG This Volume: %i\n", vmgi_mat->vmg_this_volume_nr);
-  printf("Disc side %i\n", vmgi_mat->disc_side);
-  printf("VMG Number of Title Sets %i\n", vmgi_mat->vmg_nr_of_title_sets);
-  printf("Provider ID: %.32s\n", vmgi_mat->provider_identifier);
-  printf("VMG POS Code: %08x", (uint32_t)(vmgi_mat->vmg_pos_code >> 32));
-  printf("%08x\n", (uint32_t)vmgi_mat->vmg_pos_code);
-  printf("End byte of VMGI_MAT: %08x\n", vmgi_mat->vmgi_last_byte);
-  printf("Start byte of First Play PGC FP PGC: %08x\n", 
-        vmgi_mat->first_play_pgc);
-  printf("Start sector of VMGM_VOBS: %08x\n", vmgi_mat->vmgm_vobs);
-  printf("Start sector of TT_SRPT: %08x\n", vmgi_mat->tt_srpt);
-  printf("Start sector of VMGM_PGCI_UT: %08x\n", vmgi_mat->vmgm_pgci_ut);
-  printf("Start sector of PTL_MAIT: %08x\n", vmgi_mat->ptl_mait);
-  printf("Start sector of VTS_ATRT: %08x\n", vmgi_mat->vts_atrt);
-  printf("Start sector of TXTDT_MG: %08x\n", vmgi_mat->txtdt_mgi);
-  printf("Start sector of VMGM_C_ADT: %08x\n", vmgi_mat->vmgm_c_adt);
-  printf("Start sector of VMGM_VOBU_ADMAP: %08x\n", 
-        vmgi_mat->vmgm_vobu_admap);
-  printf("Video attributes of VMGM_VOBS: ");
-  ifoPrint_video_attributes(5, &vmgi_mat->vmgm_video_attr);
-  printf("\n");
-  printf("VMGM Number of Audio attributes: %i\n", 
-        vmgi_mat->nr_of_vmgm_audio_streams);
-  if(vmgi_mat->nr_of_vmgm_audio_streams > 0) {
-    printf("\tstream %i status: ", 1);
-    ifoPrint_audio_attributes(5, &vmgi_mat->vmgm_audio_attr);
-    printf("\n");
-  }
-  printf("VMGM Number of Sub-picture attributes: %i\n", 
-        vmgi_mat->nr_of_vmgm_subp_streams);
-  if(vmgi_mat->nr_of_vmgm_subp_streams > 0) {
-    printf("\tstream %2i status: ", 1);
-    ifoPrint_subp_attributes(5, &vmgi_mat->vmgm_subp_attr);
-    printf("\n");
-  }
-}
-
-
-void ifoPrint_VTSI_MAT(vtsi_mat_t *vtsi_mat) {
-  int i;
-
-  printf("VTS Identifier: %.12s\n", vtsi_mat->vts_identifier);
-  printf("Last Sector of VTS: %08x\n", vtsi_mat->vts_last_sector);
-  printf("Last Sector of VTSI: %08x\n", vtsi_mat->vtsi_last_sector);
-  printf("Specification version number: %01x.%01x\n", 
-        vtsi_mat->specification_version>>4, 
-        vtsi_mat->specification_version&0xf);
-  printf("VTS Category: %08x\n", vtsi_mat->vts_category);
-  printf("End byte of VTSI_MAT: %08x\n", vtsi_mat->vtsi_last_byte);
-  printf("Start sector of VTSM_VOBS:  %08x\n", vtsi_mat->vtsm_vobs);
-  printf("Start sector of VTSTT_VOBS: %08x\n", vtsi_mat->vtstt_vobs);
-  printf("Start sector of VTS_PTT_SRPT: %08x\n", vtsi_mat->vts_ptt_srpt);
-  printf("Start sector of VTS_PGCIT:    %08x\n", vtsi_mat->vts_pgcit);
-  printf("Start sector of VTSM_PGCI_UT: %08x\n", vtsi_mat->vtsm_pgci_ut);
-  printf("Start sector of VTS_TMAPT:    %08x\n", vtsi_mat->vts_tmapt);
-  printf("Start sector of VTSM_C_ADT:      %08x\n", vtsi_mat->vtsm_c_adt);
-  printf("Start sector of VTSM_VOBU_ADMAP: %08x\n",vtsi_mat->vtsm_vobu_admap);
-  printf("Start sector of VTS_C_ADT:       %08x\n", vtsi_mat->vts_c_adt);
-  printf("Start sector of VTS_VOBU_ADMAP:  %08x\n", vtsi_mat->vts_vobu_admap);
-
-  printf("Video attributes of VTSM_VOBS: ");
-  ifoPrint_video_attributes(5, &vtsi_mat->vtsm_video_attr);
-  printf("\n");
-  
-  printf("VTSM Number of Audio attributes: %i\n", 
-        vtsi_mat->nr_of_vtsm_audio_streams);
-  if(vtsi_mat->nr_of_vtsm_audio_streams > 0) {
-    printf("\tstream %i status: ", 1);
-    ifoPrint_audio_attributes(5, &vtsi_mat->vtsm_audio_attr);
-    printf("\n");
-  }
-  
-  printf("VTSM Number of Sub-picture attributes: %i\n", 
-        vtsi_mat->nr_of_vtsm_subp_streams);
-  if(vtsi_mat->nr_of_vtsm_subp_streams > 0) {
-    printf("\tstream %2i status: ", 1);
-    ifoPrint_subp_attributes(5, &vtsi_mat->vtsm_subp_attr);
-    printf("\n");
-  }
-  
-  printf("Video attributes of VTS_VOBS: ");
-  ifoPrint_video_attributes(5, &vtsi_mat->vts_video_attr);
-  printf("\n");
-  
-  printf("VTS Number of Audio attributes: %i\n", 
-        vtsi_mat->nr_of_vts_audio_streams);
-  for(i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++) {
-    printf("\tstream %i status: ", i);
-    ifoPrint_audio_attributes(5, &vtsi_mat->vts_audio_attr[i]);
-    printf("\n");
-  }
-  
-  printf("VTS Number of Subpicture attributes: %i\n", 
-        vtsi_mat->nr_of_vts_subp_streams);
-  for(i = 0; i < vtsi_mat->nr_of_vts_subp_streams; i++) {
-    printf("\tstream %2i status: ", i);
-    ifoPrint_subp_attributes(5, &vtsi_mat->vts_subp_attr[i]);
-    printf("\n");
-  }
-}
-
-
-static void ifoPrint_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) {
-  int i;
-  
-  if(cmd_tbl == NULL) {
-    printf("No Command table present\n");
-    return;
-  }
-  
-  printf("Number of Pre commands: %i\n", cmd_tbl->nr_of_pre);
-  for(i = 0; i < cmd_tbl->nr_of_pre; i++) {
-    ifoPrint_CMD(i, &cmd_tbl->pre_cmds[i]);
-  }
-
-  printf("Number of Post commands: %i\n", cmd_tbl->nr_of_post);
-  for(i = 0; i < cmd_tbl->nr_of_post; i++) {
-    ifoPrint_CMD(i, &cmd_tbl->post_cmds[i]);
-  }
-
-  printf("Number of Cell commands: %i\n", cmd_tbl->nr_of_cell);
-  for(i = 0; i < cmd_tbl->nr_of_cell; i++) {
-    ifoPrint_CMD(i, &cmd_tbl->cell_cmds[i]);
-  }
-}
-
-
-static void ifoPrint_PGC_PROGRAM_MAP(pgc_program_map_t *program_map, int nr) {
-  int i;
-  
-  if(program_map == NULL) {
-    printf("No Program map present\n");
-    return;
-  }
-  
-  for(i = 0; i < nr; i++) {
-    printf("Program %3i Entry Cell: %3i\n", i + 1, program_map[i]);
-  }
-}
-
-
-static void ifoPrint_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) {
-  int i;
-  
-  if(cell_playback == NULL) {
-    printf("No Cell Playback info present\n");
-    return;
-  }
-  
-  for(i=0;i<nr;i++) {
-    printf("Cell: %3i ", i + 1);
-
-    ifoPrint_time(5, &cell_playback[i].playback_time);
-    printf("\t");
-
-    if(cell_playback[i].block_mode || cell_playback[i].block_type) {
-      const char *s;
-      switch(cell_playback[i].block_mode) {
-      case 0:
-       s = "not a"; break;
-      case 1:
-       s = "the first"; break;
-      case 2:
-      default:
-       s = ""; break;
-      case 3:
-       s = "last"; break;
-      }
-      printf("%s cell in the block ", s);
-      
-      switch(cell_playback[i].block_type) {
-      case 0:
-       printf("not part of the block ");
-       break;
-      case 1:
-       printf("angle block ");
-       break;
-      case 2:
-      case 3:
-       printf("(send bug repport) ");
-       break;
-      }
-    }
-    if(cell_playback[i].seamless_play)
-      printf("presented seamlessly ");
-    if(cell_playback[i].interleaved)
-      printf("cell is interleaved ");
-    if(cell_playback[i].stc_discontinuity)
-      printf("STC_discontinuty ");
-    if(cell_playback[i].seamless_angle)
-      printf("only seamless angle ");
-    if(cell_playback[i].restricted)
-      printf("restricted cell ");
-    
-    if(cell_playback[i].still_time)
-      printf("still time %d ", cell_playback[i].still_time);
-    if(cell_playback[i].cell_cmd_nr)
-      printf("cell command %d", cell_playback[i].cell_cmd_nr);
-    
-    printf("\n\tStart sector: %08x\tFirst ILVU end  sector: %08x\n", 
-          cell_playback[i].first_sector, 
-          cell_playback[i].first_ilvu_end_sector);
-    printf("\tEnd   sector: %08x\tLast VOBU start sector: %08x\n", 
-          cell_playback[i].last_sector, 
-          cell_playback[i].last_vobu_start_sector);
-  }
-}
-
-static void ifoPrint_CELL_POSITION(cell_position_t *cell_position, int nr) {
-  int i;
-  
-  if(cell_position == NULL) {
-    printf("No Cell Position info present\n");
-    return;
-  }
-  
-  for(i=0;i<nr;i++) {
-    printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1, 
-          cell_position[i].vob_id_nr, cell_position[i].cell_nr);
-  }
-}
-
-
-void ifoPrint_PGC(pgc_t *pgc) {
-  int i;
-  
-  printf("Number of Programs: %i\n", pgc->nr_of_programs);
-  printf("Number of Cells: %i\n", pgc->nr_of_cells);
-  /* Check that time is 0:0:0:0 also if nr_of_programs==0 */
-  printf("Playback time: ");
-  ifoPrint_time(5, &pgc->playback_time); printf("\n");
-
-  /* If no programs/no time then does this mean anything? */
-  printf("Prohibited user operations: ");
-  ifoPrint_USER_OPS(&pgc->prohibited_ops);
-  
-    for(i = 0; i < 8; i++) {
-      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] & 0x80000000) { /* The 'is present' bit */
-      printf("Subpicture stream %2i control: %08x\n", 
-            i, pgc->subp_control[i]);
-    }
-  }
-  
-  printf("Next PGC number: %i\n", pgc->next_pgc_nr);
-  printf("Prev PGC number: %i\n", pgc->prev_pgc_nr);
-  printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr);
-  if(pgc->nr_of_programs != 0) {
-    printf("Still time: %i seconds (255=inf)\n", pgc->still_time);
-    printf("PG Playback mode %02x\n", pgc->pg_playback_mode);
-  }
-  
-  if(pgc->nr_of_programs != 0) {
-    for(i = 0; i < 16; i++) {
-      printf("Color %2i: %08x\n", i, pgc->palette[i]);
-    }
-  }
-  
-  /* Memmory offsets to div. tables. */
-  ifoPrint_PGC_COMMAND_TBL(pgc->command_tbl);
-  ifoPrint_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs);
-  ifoPrint_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells);
-  ifoPrint_CELL_POSITION(pgc->cell_position, pgc->nr_of_cells);
-}
-
-
-void ifoPrint_TT_SRPT(tt_srpt_t *tt_srpt) {
-  int i;
-  
-  printf("Number of TitleTrack search pointers: %i\n",
-        tt_srpt->nr_of_srpts);
-  for(i=0;i<tt_srpt->nr_of_srpts;i++) {
-    printf("Title Track index %i\n", i + 1);
-    printf("\tTitle set number (VTS): %i", 
-          tt_srpt->title[i].title_set_nr);
-    printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn);
-    printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts);
-    printf("\tNumber of angles: %i\n", 
-          tt_srpt->title[i].nr_of_angles);
-    printf("\tTitle playback type: %02x\n",     /* XXX: TODO FIXME */
-          *(uint8_t *)&(tt_srpt->title[i].pb_ty));
-    printf("\tParental ID field: %04x\n",
-          tt_srpt->title[i].parental_id);
-    printf("\tTitle set starting sector %08x\n", 
-          tt_srpt->title[i].title_set_sector);
-  }
-}
-
-
-void ifoPrint_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) {
-  int i, j;
-  printf(" nr_of_srpts %i last byte %i\n", 
-        vts_ptt_srpt->nr_of_srpts, 
-        vts_ptt_srpt->last_byte);
-  for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) {
-    for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) {
-      printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n",
-            i + 1, j + 1, 
-            vts_ptt_srpt->title[i].ptt[j].pgcn,
-            vts_ptt_srpt->title[i].ptt[j].pgn );
-    }
-  }
-}
-
-
-static void hexdump(uint8_t *ptr, int len) {
-  while(len--)
-    printf("%02x ", *ptr++);
-}
-
-void ifoPrint_PTL_MAIT(ptl_mait_t *ptl_mait) {
-  int i, j;
-  
-  printf("Number of Countries: %i\n", ptl_mait->nr_of_countries);
-  printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss);
-  //printf("Last byte: %i\n", ptl_mait->last_byte);
-  
-  for(i = 0; i < ptl_mait->nr_of_countries; i++) {
-    printf("Country code: %c%c\n", 
-          ptl_mait->countries[i].country_code >> 8,
-          ptl_mait->countries[i].country_code & 0xff);
-    /*
-      printf("Start byte: %04x %i\n", 
-      ptl_mait->countries[i].pf_ptl_mai_start_byte, 
-      ptl_mait->countries[i].pf_ptl_mai_start_byte);
-    */
-    /* This seems to be pointing at a array with 8 2byte fields per VTS
-       ? and one extra for the menu? always an odd number of VTSs on
-       all the dics I tested so it might be padding to even also.
-       If it is for the menu it probably the first entry.  */
-    for(j=0;j<8;j++) {
-      hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE 
-              + ptl_mait->countries[i].pf_ptl_mai_start_byte
-              + j*(ptl_mait->nr_of_vtss+1)*2, (ptl_mait->nr_of_vtss+1)*2);
-      printf("\n");
-    }
-  }
-}
-
-
-void ifoPrint_C_ADT(c_adt_t *c_adt) {
-  int i, entries;
-  
-  printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs);
-  entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t);
-  
-  for(i = 0; i < entries; i++) {
-    printf("VOB ID: %3i, Cell ID: %3i   ", 
-          c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id);
-    printf("Sector (first): 0x%08x   (last): 0x%08x\n",
-          c_adt->cell_adr_table[i].start_sector, 
-          c_adt->cell_adr_table[i].last_sector);
-  }
-}
-
-
-void ifoPrint_VOBU_ADMAP(vobu_admap_t *vobu_admap) {
-  int i, entries;
-  
-  entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4;
-  for(i = 0; i < entries; i++) {
-    printf("VOBU %5i  First sector: 0x%08x\n", i + 1,
-          vobu_admap->vobu_start_sectors[i]);
-  }
-}
-
-
-void ifoPrint_PGCIT(pgcit_t *pgcit) {
-  int i;
-  
-  for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
-    printf("\nProgram (PGC): %3i\t", i + 1);
-    printf("PGC Category: Entry id 0x%02x, ", pgcit->pgci_srp[i].entry_id);
-    printf("Parental ID mask 0x%04x\n", pgcit->pgci_srp[i].ptl_id_mask);
-    ifoPrint_PGC(pgcit->pgci_srp[i].pgc);
-  }
-}
-
-
-void ifoPrint_PGCI_UT(pgci_ut_t *pgci_ut) {
-  int i;
-  
-  printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus);
-  for(i = 0; i < pgci_ut->nr_of_lus; i++) {
-    printf("\nMenu Language Code: %c%c\n",
-          pgci_ut->lu[i].lang_code >> 8,
-          pgci_ut->lu[i].lang_code & 0xff);
-    printf("Menu Existence: %02x\n", pgci_ut->lu[i].exists);
-    ifoPrint_PGCIT(pgci_ut->lu[i].pgcit);
-  }
-}
-
-
-void ifoPrint_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) {
-  int i;
-  
-  printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat);
-  printf("Video attributes of VTSM_VOBS: ");
-  ifoPrint_video_attributes(5, &vts_attributes->vtsm_vobs_attr);
-  printf("\n");
-  printf("Number of Audio streams: %i\n", 
-        vts_attributes->nr_of_vtsm_audio_streams);
-  if(vts_attributes->nr_of_vtsm_audio_streams > 0) {
-    printf("\tstream %i attributes: ", 1);
-    ifoPrint_audio_attributes(5, &vts_attributes->vtsm_audio_attr);
-    printf("\n");
-  }
-  printf("Number of Subpicture streams: %i\n", 
-        vts_attributes->nr_of_vtsm_subp_streams);
-  if(vts_attributes->nr_of_vtsm_subp_streams > 0) {
-    printf("\tstream %2i attributes: ", 1);
-    ifoPrint_subp_attributes(5, &vts_attributes->vtsm_subp_attr);
-    printf("\n");
-  }
-   
-  printf("Video attributes of VTSTT_VOBS: ");
-  ifoPrint_video_attributes(5, &vts_attributes->vtstt_vobs_video_attr);
-  printf("\n");
-  printf("Number of Audio streams: %i\n", 
-        vts_attributes->nr_of_vtstt_audio_streams);
-  for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) {
-    printf("\tstream %i attributes: ", i);
-    ifoPrint_audio_attributes(5, &vts_attributes->vtstt_audio_attr[i]);
-    printf("\n");
-  }
-  
-  printf("Number of Subpicture streams: %i\n", 
-        vts_attributes->nr_of_vtstt_subp_streams);
-  for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) {
-    printf("\tstream %2i attributes: ", i);    
-    ifoPrint_subp_attributes(5, &vts_attributes->vtstt_subp_attr[i]);
-    printf("\n");
-  }
-}
-
-
-void ifoPrint_VTS_ATRT(vts_atrt_t *vts_atrt) {
-  int i;
-  
-  printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss);
-  for(i = 0; i < vts_atrt->nr_of_vtss; i++) {
-    printf("\nVideo Title Set %i\n", i + 1);
-    ifoPrint_VTS_ATTRIBUTES(&vts_atrt->vts[i]);
-  }
-}
-
-
-void ifoPrint(dvd_reader_t *dvd, int title) {
-  ifo_handle_t *ifohandle;
-
-  ifohandle = ifoOpen(dvd, title);
-  if(!ifohandle) {
-    fprintf(stderr, "Can't open info file for title %d\n", title);
-    return;
-  }
-  
-  
-  if(ifohandle->vmgi_mat) {
-
-    printf("VMG top level\n-------------\n");
-    ifoPrint_VMGI_MAT(ifohandle->vmgi_mat);
-
-    printf("\nFirst Play PGC\n--------------\n");
-    ifoPrint_PGC(ifohandle->first_play_pgc);
-
-    printf("\nTitle Track search pointer table\n");
-    printf(  "------------------------------------------------\n");
-    ifoPrint_TT_SRPT(ifohandle->tt_srpt);
-
-    printf("\nMenu PGCI Unit table\n");
-    printf(  "--------------------\n");
-    if(ifohandle->pgci_ut) {
-      ifoPrint_PGCI_UT(ifohandle->pgci_ut);
-    } else {
-      printf("No PGCI Unit table present\n");
-    }
-
-    printf("\nParental Manegment Information table\n");
-    printf(  "------------------------------------\n");
-    if(ifohandle->ptl_mait) {
-      ifoPrint_PTL_MAIT(ifohandle->ptl_mait);
-    } else {
-      printf("No Parental Management Information present\n");
-    }
-
-    printf("\nVideo Title Set Attribute Table\n");
-    printf(  "-------------------------------\n");
-    ifoPrint_VTS_ATRT(ifohandle->vts_atrt);
-    
-    printf("\nText Data Manager Information\n");
-    printf(  "-----------------------------\n");
-    if(ifohandle->txtdt_mgi) {
-      //ifoPrint_TXTDT_MGI(&(vmgi->txtdt_mgi));
-    } else {
-      printf("No Text Data Manager Information present\n");
-    }
-
-    printf("\nMenu Cell Adress table\n");
-    printf(  "-----------------\n");
-    if(ifohandle->menu_c_adt) {
-      ifoPrint_C_ADT(ifohandle->menu_c_adt);
-    } else {
-      printf("No Menu Cell Adress table present\n");
-    }
-
-    printf("\nVideo Manager Menu VOBU address map\n");
-    printf(  "-----------------\n");
-    if(ifohandle->menu_vobu_admap) {
-      ifoPrint_VOBU_ADMAP(ifohandle->menu_vobu_admap);
-    } else {
-      printf("No Menu VOBU address map present\n");   
-    }
-  }
-
-
-  if(ifohandle->vtsi_mat) {
-
-    printf("VTS top level\n-------------\n");
-    ifoPrint_VTSI_MAT(ifohandle->vtsi_mat);
-
-    printf("\nPart of Title Track search pointer table\n");
-    printf(  "----------------------------------------------\n");
-    ifoPrint_VTS_PTT_SRPT(ifohandle->vts_ptt_srpt);
-
-    printf("\nPGCI Unit table\n");
-    printf(  "--------------------\n");
-    ifoPrint_PGCIT(ifohandle->vts_pgcit);
-
-    printf("\nMenu PGCI Unit table\n");
-    printf(  "--------------------\n");
-    if(ifohandle->pgci_ut) {
-      ifoPrint_PGCI_UT(ifohandle->pgci_ut);
-    } else {
-      printf("No Menu PGCI Unit table present\n");
-    }
-
-    printf("\nMenu Cell Adress table\n");
-    printf(  "-----------------\n");
-    if(ifohandle->menu_c_adt) {
-      ifoPrint_C_ADT(ifohandle->menu_c_adt);
-    } else {
-      printf("No Cell Adress table present\n");
-    }
-
-    printf("\nVideo Title Set Menu VOBU address map\n");
-    printf(  "-----------------\n");
-    if(ifohandle->menu_vobu_admap) {
-      ifoPrint_VOBU_ADMAP(ifohandle->menu_vobu_admap);
-    } else {
-      printf("No Menu VOBU address map present\n");
-    }
-
-    printf("\nCell Adress table\n");
-    printf(  "-----------------\n");
-    ifoPrint_C_ADT(ifohandle->vts_c_adt);
-
-    printf("\nVideo Title Set VOBU address map\n");
-    printf(  "-----------------\n");
-    ifoPrint_VOBU_ADMAP(ifohandle->vts_vobu_admap);
-  } 
-
-  ifoClose(ifohandle);
-}
-
diff --git a/extras/libdvdread/ifo_print.h b/extras/libdvdread/ifo_print.h
deleted file mode 100644 (file)
index dd92a60..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (C) 2000 Björn Englund <d4bjorn@dtek.chalmers.se>,
- *                    Håkan Hjort <d95hjort@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
- */
-
-#ifndef IFO_PRINT_H_INCLUDED
-#define IFO_PRINT_H_INCLUDED
-
-#include "ifo_types.h"
-#include "dvd_reader.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * This file provides example functions for printing information about the IFO
- * file to stdout.
- */
-
-/**
- * Print the complete parsing information for the given file.
- */
-void ifoPrint(dvd_reader_t *dvd, int title);
-
-void ifoPrint_VMGI_MAT(vmgi_mat_t *vmgi_mat);
-void ifoPrint_VTSI_MAT(vtsi_mat_t *vtsi_mat);
-
-void ifoPrint_PTL_MAIT(ptl_mait_t *ptl_mait);
-void ifoPrint_VTS_ATRT(vts_atrt_t *vts_atrt);
-void ifoPrint_TT_SRPT(tt_srpt_t *vmg_ptt_srpt);
-void ifoPrint_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt);
-void ifoPrint_PGC(pgc_t *pgc);
-void ifoPrint_PGCIT(pgcit_t *pgcit);
-void ifoPrint_PGCI_UT(pgci_ut_t *pgci_ut);
-void ifoPrint_C_ADT(c_adt_t *c_adt);
-void ifoPrint_VOBU_ADMAP(vobu_admap_t *vobu_admap);
-
-#ifdef __cplusplus
-};
-#endif
-#endif /* IFO_PRINT_H_INCLUDED */
diff --git a/extras/libdvdread/ifo_read.c b/extras/libdvdread/ifo_read.c
deleted file mode 100644 (file)
index 63cc1a3..0000000
+++ /dev/null
@@ -1,1777 +0,0 @@
-/*
- * Copyright (C) 2000 Björn Englund <d4bjorn@dtek.chalmers.se>, 
- *                    Håkan Hjort <d95hjort@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
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <string.h>
-#include <assert.h>
-
-#include "dvd_reader.h"
-
-#include "config.h" // Needed for WORDS_BIGENDIAN
-#include "bswap.h"
-#include "ifo_types.h"
-#include "ifo_read.h"
-
-#ifndef DVD_BLOCK_LEN
-#define DVD_BLOCK_LEN 2048
-#endif
-
-#ifndef NDEBUG
-#define CHECK_ZERO(arg) \
-  if(memcmp(my_friendly_zeros, &arg, sizeof(arg))) { \
-    unsigned int i_CZ; \
-    fprintf(stderr, "*** Zero check failed in %s:%i\n    for %s = 0x", \
-            __FILE__, __LINE__, # arg ); \
-    for(i_CZ = 0; i_CZ < sizeof(arg); i_CZ++) \
-      fprintf(stderr, "%02x", *((uint8_t *)&arg + i_CZ)); \
-    fprintf(stderr, "\n"); \
-  }
-static const uint8_t my_friendly_zeros[2048];
-#else
-#define CHECK_ZERO(arg) (void)(arg)
-#endif
-
-
-/* Prototypes for internal functions */
-static int ifoRead_VMG(ifo_handle_t *ifofile);
-static int ifoRead_VTS(ifo_handle_t *ifofile);
-static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset);
-static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile, 
-                                   pgc_command_tbl_t *cmd_tbl, 
-                                  unsigned int offset);
-static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile, 
-                                   pgc_program_map_t *program_map, 
-                                   unsigned int nr, unsigned int offset);
-static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile, 
-                                     cell_playback_t *cell_playback, 
-                                     unsigned int nr, unsigned int offset);
-static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile, 
-                                     cell_position_t *cell_position, 
-                                     unsigned int nr, unsigned int offset);
-static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile, 
-                                  vts_attributes_t *vts_attributes, 
-                                  unsigned int offset);
-static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, c_adt_t *c_adt, 
-                                  unsigned int sector);
-static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile, 
-                                       vobu_admap_t *vobu_admap, 
-                                      unsigned int sector);
-static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit, 
-                                  unsigned int offset);
-
-static void ifoFree_PGC(pgc_t *pgc);
-static void ifoFree_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl);
-static void ifoFree_PGCIT_internal(pgcit_t *pgcit);
-
-
-static int DVDFileSeek_( dvd_file_t *dvd_file, uint32_t offset ) {
-  return (DVDFileSeek(dvd_file, (int)offset) == (int)offset);
-}
-
-
-ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
-  ifo_handle_t *ifofile;
-
-  ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
-  if(!ifofile)
-    return 0;
-
-  memset(ifofile, 0, sizeof(ifo_handle_t));
-
-  ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_FILE);
-  if(!ifofile->file) {
-    if(title) {
-      fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.IFO.\n", title);
-    } else {
-      fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.IFO.\n");
-    }
-    free(ifofile);
-    return 0;
-  }
-
-  /* First check if this is a VMGI file. */
-  if(ifoRead_VMG(ifofile)) {
-
-    /* These are both mandatory. */
-    if(!ifoRead_FP_PGC(ifofile) || !ifoRead_TT_SRPT(ifofile)) {
-      fprintf(stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
-      ifoClose(ifofile);
-      return 0;
-    }
-
-    ifoRead_PGCI_UT(ifofile);
-    ifoRead_PTL_MAIT(ifofile);
-
-    /* This is also mandatory. */
-    if(!ifoRead_VTS_ATRT(ifofile)) {
-      fprintf(stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
-      ifoClose(ifofile);
-      return 0;
-    }
-
-    ifoRead_TXTDT_MGI(ifofile);
-    ifoRead_C_ADT(ifofile);
-    ifoRead_VOBU_ADMAP(ifofile);
-
-    return ifofile;
-  }
-
-  if(ifoRead_VTS(ifofile)) {
-
-    if(!ifoRead_VTS_PTT_SRPT(ifofile) || !ifoRead_PGCIT(ifofile)) {
-      fprintf(stderr, "libdvdread: Invalid title IFO (VTS_%02d_0.IFO).\n",
-              title);
-      ifoClose(ifofile);
-      return 0;
-    }
-
-
-    ifoRead_PGCI_UT(ifofile);
-    ifoRead_C_ADT(ifofile);
-    ifoRead_VOBU_ADMAP(ifofile);
-
-    if(!ifoRead_TITLE_C_ADT(ifofile) || !ifoRead_TITLE_VOBU_ADMAP(ifofile)) {
-      fprintf(stderr, "libdvdread: Invalid title IFO (VTS_%02d_0.IFO).\n",
-              title);
-      ifoClose(ifofile);
-      return 0;
-    }
-
-    return ifofile;
-  }
-
-  fprintf(stderr, "libdvdread: Invalid IFO for title %d (VTS_%02d_0.IFO).\n",
-          title, title);
-  ifoClose(ifofile);
-  return 0;
-}
-
-
-ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd) {
-  ifo_handle_t *ifofile;
-
-  ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
-  if(!ifofile)
-    return 0;
-
-  memset(ifofile, 0, sizeof(ifo_handle_t));
-
-  ifofile->file = DVDOpenFile(dvd, 0, DVD_READ_INFO_FILE);
-  if(!ifofile->file) {
-    fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.IFO.\n");
-    free(ifofile);
-    return 0;
-  }
-
-  if(ifoRead_VMG(ifofile))
-    return ifofile;
-
-  fprintf(stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
-  ifoClose(ifofile);
-  return 0;
-}
-
-
-ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) {
-  ifo_handle_t *ifofile;
-  
-  ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
-  if(!ifofile)
-    return 0;
-
-  memset(ifofile, 0, sizeof(ifo_handle_t));
-
-  ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_FILE);
-  if(!ifofile->file) {
-    fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.IFO.\n", title);
-    free(ifofile);
-    return 0;
-  }
-
-  ifoRead_VTS(ifofile);
-  if(ifofile->vtsi_mat)
-    return ifofile;
-
-  fprintf(stderr, "libdvdread: Invalid IFO for title %d (VTS_%02d_0.IFO).\n",
-          title, title);
-  ifoClose(ifofile);
-  return 0;
-}
-
-
-void ifoClose(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  ifoFree_VOBU_ADMAP(ifofile);
-  ifoFree_TITLE_VOBU_ADMAP(ifofile);
-  ifoFree_C_ADT(ifofile);
-  ifoFree_TITLE_C_ADT(ifofile);
-  ifoFree_TXTDT_MGI(ifofile);
-  ifoFree_VTS_ATRT(ifofile);
-  ifoFree_PTL_MAIT(ifofile);
-  ifoFree_PGCI_UT(ifofile);
-  ifoFree_TT_SRPT(ifofile);
-  ifoFree_FP_PGC(ifofile);
-  ifoFree_PGCIT(ifofile);
-  ifoFree_VTS_PTT_SRPT(ifofile);
-
-  if(ifofile->vmgi_mat)
-    free(ifofile->vmgi_mat);
-
-  if(ifofile->vtsi_mat)
-    free(ifofile->vtsi_mat);
-
-  DVDCloseFile(ifofile->file);
-  ifofile->file = 0;
-  free(ifofile);
-  ifofile = 0;
-}
-
-
-static int ifoRead_VMG(ifo_handle_t *ifofile) {
-  vmgi_mat_t *vmgi_mat;
-
-  vmgi_mat = (vmgi_mat_t *)malloc(sizeof(vmgi_mat_t));
-  if(!vmgi_mat)
-    return 0;
-
-  ifofile->vmgi_mat = vmgi_mat;
-
-  if(!DVDFileSeek_(ifofile->file, 0)) {
-    free(ifofile->vmgi_mat);
-    ifofile->vmgi_mat = 0;
-    return 0;
-  }
-
-  if(!DVDReadBytes(ifofile->file, vmgi_mat, sizeof(vmgi_mat_t))) {
-    free(ifofile->vmgi_mat);
-    ifofile->vmgi_mat = 0;
-    return 0;
-  }
-
-  if(strncmp("DVDVIDEO-VMG", vmgi_mat->vmg_identifier, 12) != 0) {
-    free(ifofile->vmgi_mat);
-    ifofile->vmgi_mat = 0;
-    return 0;
-  }
-  
-  B2N_32(vmgi_mat->vmg_last_sector);
-  B2N_32(vmgi_mat->vmgi_last_sector);
-  B2N_32(vmgi_mat->vmg_category);
-  B2N_16(vmgi_mat->vmg_nr_of_volumes);
-  B2N_16(vmgi_mat->vmg_this_volume_nr);
-  B2N_16(vmgi_mat->vmg_nr_of_title_sets);
-  B2N_64(vmgi_mat->vmg_pos_code);
-  B2N_32(vmgi_mat->vmgi_last_byte);
-  B2N_32(vmgi_mat->first_play_pgc);
-  B2N_32(vmgi_mat->vmgm_vobs);
-  B2N_32(vmgi_mat->tt_srpt);
-  B2N_32(vmgi_mat->vmgm_pgci_ut);
-  B2N_32(vmgi_mat->ptl_mait);
-  B2N_32(vmgi_mat->vts_atrt);
-  B2N_32(vmgi_mat->txtdt_mgi);
-  B2N_32(vmgi_mat->vmgm_c_adt);
-  B2N_32(vmgi_mat->vmgm_vobu_admap);
-  B2N_16(vmgi_mat->vmgm_audio_attr.lang_code);
-  B2N_16(vmgi_mat->vmgm_subp_attr.lang_code);
-
-
-  CHECK_ZERO(vmgi_mat->zero_1);
-  CHECK_ZERO(vmgi_mat->zero_2);
-  CHECK_ZERO(vmgi_mat->zero_3);
-  CHECK_ZERO(vmgi_mat->zero_4);
-  CHECK_ZERO(vmgi_mat->zero_5);
-  CHECK_ZERO(vmgi_mat->zero_6);
-  CHECK_ZERO(vmgi_mat->zero_7);
-  CHECK_ZERO(vmgi_mat->zero_8);
-  CHECK_ZERO(vmgi_mat->zero_9);
-  CHECK_ZERO(vmgi_mat->zero_10);  
-  assert(vmgi_mat->vmg_last_sector != 0);
-  assert(vmgi_mat->vmgi_last_sector != 0);
-  assert(vmgi_mat->vmgi_last_sector * 2 <= vmgi_mat->vmg_last_sector);
-  assert(vmgi_mat->vmg_nr_of_volumes != 0);
-  assert(vmgi_mat->vmg_this_volume_nr != 0);
-  assert(vmgi_mat->vmg_this_volume_nr <= vmgi_mat->vmg_nr_of_volumes);
-  assert(vmgi_mat->disc_side == 1 || vmgi_mat->disc_side == 2);
-  assert(vmgi_mat->vmg_nr_of_title_sets != 0);
-  assert(vmgi_mat->vmgi_last_byte >= 341);
-  assert(vmgi_mat->vmgi_last_byte / DVD_BLOCK_LEN <= 
-         vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->first_play_pgc != 0 && 
-         vmgi_mat->first_play_pgc < vmgi_mat->vmgi_last_byte);
-  assert(vmgi_mat->vmgm_vobs == 0 || 
-        (vmgi_mat->vmgm_vobs > vmgi_mat->vmgi_last_sector &&
-         vmgi_mat->vmgm_vobs < vmgi_mat->vmg_last_sector));
-  assert(vmgi_mat->tt_srpt <= vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->vmgm_pgci_ut <= vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->ptl_mait <= vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->vts_atrt <= vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->txtdt_mgi <= vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->vmgm_c_adt <= vmgi_mat->vmgi_last_sector);
-  assert(vmgi_mat->vmgm_vobu_admap <= vmgi_mat->vmgi_last_sector);
-
-  assert(vmgi_mat->nr_of_vmgm_audio_streams <= 1);
-  assert(vmgi_mat->nr_of_vmgm_subp_streams <= 1);
-
-  return 1;
-}
-
-
-static int ifoRead_VTS(ifo_handle_t *ifofile) {
-  vtsi_mat_t *vtsi_mat;
-  int i;
-
-  vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t));
-  if(!vtsi_mat)
-    return 0;
-  
-  ifofile->vtsi_mat = vtsi_mat;
-
-  if(!DVDFileSeek_(ifofile->file, 0)) {
-    free(ifofile->vtsi_mat);
-    ifofile->vtsi_mat = 0;
-    return 0;
-  }
-
-  if(!(DVDReadBytes(ifofile->file, vtsi_mat, sizeof(vtsi_mat_t)))) {
-    free(ifofile->vtsi_mat);
-    ifofile->vtsi_mat = 0;
-    return 0;
-  }
-
-  if(strncmp("DVDVIDEO-VTS", vtsi_mat->vts_identifier, 12) != 0) {
-    free(ifofile->vtsi_mat);
-    ifofile->vtsi_mat = 0;
-    return 0;
-  }
-
-  B2N_32(vtsi_mat->vts_last_sector);
-  B2N_32(vtsi_mat->vtsi_last_sector);
-  B2N_32(vtsi_mat->vts_category);
-  B2N_32(vtsi_mat->vtsi_last_byte);
-  B2N_32(vtsi_mat->vtsm_vobs);
-  B2N_32(vtsi_mat->vtstt_vobs);
-  B2N_32(vtsi_mat->vts_ptt_srpt);
-  B2N_32(vtsi_mat->vts_pgcit);
-  B2N_32(vtsi_mat->vtsm_pgci_ut);
-  B2N_32(vtsi_mat->vts_tmapt);
-  B2N_32(vtsi_mat->vtsm_c_adt);
-  B2N_32(vtsi_mat->vtsm_vobu_admap);
-  B2N_32(vtsi_mat->vts_c_adt);
-  B2N_32(vtsi_mat->vts_vobu_admap);
-  B2N_16(vtsi_mat->vtsm_audio_attr.lang_code);
-  B2N_16(vtsi_mat->vtsm_subp_attr.lang_code);
-  for(i = 0; i < 8; i++)
-    B2N_16(vtsi_mat->vts_audio_attr[i].lang_code);
-  for(i = 0; i < 32; i++)
-    B2N_16(vtsi_mat->vts_subp_attr[i].lang_code);
-
-
-  CHECK_ZERO(vtsi_mat->zero_1);
-  CHECK_ZERO(vtsi_mat->zero_2);
-  CHECK_ZERO(vtsi_mat->zero_3);
-  CHECK_ZERO(vtsi_mat->zero_4);
-  CHECK_ZERO(vtsi_mat->zero_5);
-  CHECK_ZERO(vtsi_mat->zero_6);
-  CHECK_ZERO(vtsi_mat->zero_7);
-  CHECK_ZERO(vtsi_mat->zero_8);
-  CHECK_ZERO(vtsi_mat->zero_9);
-  CHECK_ZERO(vtsi_mat->zero_10);
-  CHECK_ZERO(vtsi_mat->zero_11);
-  CHECK_ZERO(vtsi_mat->zero_12);
-  CHECK_ZERO(vtsi_mat->zero_13);
-  CHECK_ZERO(vtsi_mat->zero_14);
-  CHECK_ZERO(vtsi_mat->zero_15);
-  CHECK_ZERO(vtsi_mat->zero_16);
-  CHECK_ZERO(vtsi_mat->zero_17);
-  CHECK_ZERO(vtsi_mat->zero_18);
-  CHECK_ZERO(vtsi_mat->zero_19);
-  CHECK_ZERO(vtsi_mat->zero_20);
-  assert(vtsi_mat->vtsi_last_sector*2 <= vtsi_mat->vts_last_sector);
-  assert(vtsi_mat->vtsi_last_byte/DVD_BLOCK_LEN <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vtsm_vobs == 0 || 
-        (vtsi_mat->vtsm_vobs > vtsi_mat->vtsi_last_sector &&
-         vtsi_mat->vtsm_vobs < vtsi_mat->vts_last_sector));
-  assert(vtsi_mat->vtstt_vobs == 0 || 
-        (vtsi_mat->vtstt_vobs > vtsi_mat->vtsi_last_sector &&
-         vtsi_mat->vtstt_vobs < vtsi_mat->vts_last_sector));
-  assert(vtsi_mat->vts_ptt_srpt <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vts_pgcit <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vtsm_pgci_ut <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vts_tmapt <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vtsm_c_adt <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vtsm_vobu_admap <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vts_c_adt <= vtsi_mat->vtsi_last_sector);
-  assert(vtsi_mat->vts_vobu_admap <= vtsi_mat->vtsi_last_sector);
-  
-  assert(vtsi_mat->nr_of_vtsm_audio_streams <= 1);
-  assert(vtsi_mat->nr_of_vtsm_subp_streams <= 1);
-
-  assert(vtsi_mat->nr_of_vts_audio_streams <= 8);
-  for(i = vtsi_mat->nr_of_vts_audio_streams; i < 8; i++)
-    CHECK_ZERO(vtsi_mat->vts_audio_attr[i]);
-
-  assert(vtsi_mat->nr_of_vts_subp_streams <= 32);
-  for(i = vtsi_mat->nr_of_vts_subp_streams; i < 32; i++)
-    CHECK_ZERO(vtsi_mat->vts_subp_attr[i]);      
-
-  return 1;
-}
-
-
-static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile, 
-                                   pgc_command_tbl_t *cmd_tbl, 
-                                  unsigned int offset) {
-  
-  memset(cmd_tbl, 0, sizeof(pgc_command_tbl_t));
-  
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, cmd_tbl, PGC_COMMAND_TBL_SIZE)))
-    return 0;
-
-  B2N_16(cmd_tbl->nr_of_pre);
-  B2N_16(cmd_tbl->nr_of_post);
-  B2N_16(cmd_tbl->nr_of_cell);
-
-  assert(cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell<= 128);
-
-  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);
-    if(!cmd_tbl->pre_cmds)
-      return 0;
-
-    if(!(DVDReadBytes(ifofile->file, cmd_tbl->pre_cmds, pre_cmds_size))) {
-      free(cmd_tbl->pre_cmds);
-      return 0;
-    }
-  }
-  
-  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);
-    if(!cmd_tbl->post_cmds) {
-      if(cmd_tbl->pre_cmds) 
-       free(cmd_tbl->pre_cmds);
-      return 0;
-    }
-    if(!(DVDReadBytes(ifofile->file, cmd_tbl->post_cmds, post_cmds_size))) {
-      if(cmd_tbl->pre_cmds) 
-       free(cmd_tbl->pre_cmds);
-      free(cmd_tbl->post_cmds);
-      return 0;
-    }
-  }
-
-  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);
-    if(!cmd_tbl->cell_cmds) {
-      if(cmd_tbl->pre_cmds)
-       free(cmd_tbl->pre_cmds);
-      if(cmd_tbl->post_cmds)
-       free(cmd_tbl->post_cmds);
-      return 0;
-    }
-    if(!(DVDReadBytes(ifofile->file, cmd_tbl->cell_cmds, cell_cmds_size))) {
-      if(cmd_tbl->pre_cmds) 
-       free(cmd_tbl->pre_cmds);
-      if(cmd_tbl->post_cmds) 
-       free(cmd_tbl->post_cmds);
-      free(cmd_tbl->cell_cmds);
-      return 0;
-    }
-  }
-  
-  /* 
-   * Make a run over all the commands and see that we can interpret them all?
-   */
-  return 1;
-}
-
-
-static void ifoFree_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) {
-  if(cmd_tbl) {
-    if(cmd_tbl->nr_of_pre && cmd_tbl->pre_cmds)
-      free(cmd_tbl->pre_cmds);
-    if(cmd_tbl->nr_of_post && cmd_tbl->post_cmds)
-      free(cmd_tbl->post_cmds);
-    if(cmd_tbl->nr_of_cell && cmd_tbl->cell_cmds)
-      free(cmd_tbl->cell_cmds);
-    free(cmd_tbl);
-  }
-}
-
-static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile, 
-                                   pgc_program_map_t *program_map, 
-                                  unsigned int nr, unsigned int offset) {
-  unsigned int size = nr * sizeof(pgc_program_map_t);
-
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-  if(!(DVDReadBytes(ifofile->file, program_map, size)))
-    return 0;
-
-  return 1;
-}
-
-static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile, 
-                                     cell_playback_t *cell_playback,
-                                     unsigned int nr, unsigned int offset) {
-  unsigned int i;
-  unsigned int size = nr * sizeof(cell_playback_t);
-
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, cell_playback, size)))
-    return 0;
-
-  for(i = 0; i < nr; i++) {
-    B2N_32(cell_playback[i].first_sector);
-    B2N_32(cell_playback[i].first_ilvu_end_sector);
-    B2N_32(cell_playback[i].last_vobu_start_sector);
-    B2N_32(cell_playback[i].last_sector);
-    
-    /* Changed < to <= because this was false in the movie 'Pi'. */
-    assert(cell_playback[i].last_vobu_start_sector <= 
-           cell_playback[i].last_sector);
-    assert(cell_playback[i].first_sector <= 
-           cell_playback[i].last_vobu_start_sector);
-  }
-
-  return 1;
-}
-
-
-static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile, 
-                                     cell_position_t *cell_position, 
-                                     unsigned int nr, unsigned int offset) {
-  unsigned int i;
-  unsigned int size = nr * sizeof(cell_position_t);
-
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, cell_position, size)))
-    return 0;
-
-  for(i = 0; i < nr; i++) {
-    B2N_16(cell_position[i].vob_id_nr);
-    CHECK_ZERO(cell_position[i].zero_1);
-  }
-
-  return 1;
-}
-
-static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset) {
-  unsigned int i;
-
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-  if(!(DVDReadBytes(ifofile->file, pgc, PGC_SIZE)))
-    return 0;
-
-  B2N_16(pgc->next_pgc_nr);
-  B2N_16(pgc->prev_pgc_nr);
-  B2N_16(pgc->goup_pgc_nr);
-  B2N_16(pgc->command_tbl_offset);
-  B2N_16(pgc->program_map_offset);
-  B2N_16(pgc->cell_playback_offset);
-  B2N_16(pgc->cell_position_offset);
-
-  for(i = 0; i < 8; i++)
-    B2N_16(pgc->audio_control[i]);
-  for(i = 0; i < 32; i++)
-    B2N_32(pgc->subp_control[i]);
-  for(i = 0; i < 16; i++)
-    B2N_32(pgc->palette[i]);
-  
-  CHECK_ZERO(pgc->zero_1);
-  assert(pgc->nr_of_programs <= pgc->nr_of_cells);
-
-  /* verify time (look at print_time) */
-  for(i = 0; i < 8; i++)
-    if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */
-      CHECK_ZERO(pgc->audio_control[i]);
-  for(i = 0; i < 32; i++)
-    if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */
-      CHECK_ZERO(pgc->subp_control[i]);
-  
-  /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */
-  if(pgc->nr_of_programs == 0) {
-    CHECK_ZERO(pgc->still_time);
-    CHECK_ZERO(pgc->pg_playback_mode); // ??
-    assert(pgc->program_map_offset == 0);
-    assert(pgc->cell_playback_offset == 0);
-    assert(pgc->cell_position_offset == 0);
-  } else {
-    assert(pgc->program_map_offset != 0);
-    assert(pgc->cell_playback_offset != 0);
-    assert(pgc->cell_position_offset != 0);
-  }
-  
-  if(pgc->command_tbl_offset != 0) {
-    pgc->command_tbl = malloc(sizeof(pgc_command_tbl_t));
-    if(!pgc->command_tbl)
-      return 0;
-
-    if(!ifoRead_PGC_COMMAND_TBL(ifofile, pgc->command_tbl, 
-                                offset + pgc->command_tbl_offset)) {
-      free(pgc->command_tbl);
-      return 0;
-    }
-  } else {
-    pgc->command_tbl = NULL;
-  }
-  
-  if(pgc->program_map_offset != 0) {
-    pgc->program_map = malloc(pgc->nr_of_programs * sizeof(pgc_program_map_t));
-    if(!pgc->program_map) {
-      ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
-      return 0;
-    }
-    if(!ifoRead_PGC_PROGRAM_MAP(ifofile, pgc->program_map,pgc->nr_of_programs,
-                                offset + pgc->program_map_offset)) {
-      ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
-      free(pgc->program_map);
-      return 0;
-    }
-  } else {
-    pgc->program_map = NULL;
-  }
-  
-  if(pgc->cell_playback_offset != 0) {
-    pgc->cell_playback = malloc(pgc->nr_of_cells * sizeof(cell_playback_t));
-    if(!pgc->cell_playback) {
-      ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
-      if(pgc->program_map)
-       free(pgc->program_map);
-      return 0;
-    }
-    if(!ifoRead_CELL_PLAYBACK_TBL(ifofile, pgc->cell_playback, 
-                                 pgc->nr_of_cells,
-                                  offset + pgc->cell_playback_offset)) {
-      ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
-      if(pgc->program_map)
-       free(pgc->program_map);
-      free(pgc->cell_playback);
-      return 0;
-    }
-  } else {
-    pgc->cell_playback = NULL;
-  }
-  
-  if(pgc->cell_position_offset != 0) {
-    pgc->cell_position = malloc(pgc->nr_of_cells * sizeof(cell_position_t));
-    if(!pgc->cell_position) {
-      ifoFree_PGC(pgc);
-      return 0;
-    }
-    if(!ifoRead_CELL_POSITION_TBL(ifofile, pgc->cell_position, 
-                                 pgc->nr_of_cells,
-                                  offset + pgc->cell_position_offset)) {
-      ifoFree_PGC(pgc);
-      return 0;
-    }
-  } else {
-    pgc->cell_position = NULL;
-  }
-
-  return 1;
-}
-
-int ifoRead_FP_PGC(ifo_handle_t *ifofile) {
-
-  if(!ifofile)
-    return 0;
-
-  if(!ifofile->vmgi_mat)
-    return 0;
-  if(ifofile->vmgi_mat->first_play_pgc == 0) /* mandatory */
-    return 0;
-  
-  ifofile->first_play_pgc = (pgc_t *)malloc(sizeof(pgc_t));
-  if(!ifofile->first_play_pgc)
-    return 0;
-  
-  if(!ifoRead_PGC(ifofile, ifofile->first_play_pgc, 
-                  ifofile->vmgi_mat->first_play_pgc)) {
-    free(ifofile->first_play_pgc);
-    ifofile->first_play_pgc = 0;
-    return 0;
-  }
-
-  return 1;
-}
-
-static void ifoFree_PGC(pgc_t *pgc) {
-  if(pgc) {
-    ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
-    if(pgc->program_map)
-      free(pgc->program_map);
-    if(pgc->cell_playback)
-      free(pgc->cell_playback);
-    if(pgc->cell_position)
-      free(pgc->cell_position);
-  }
-}
-
-void ifoFree_FP_PGC(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->first_play_pgc) {
-    ifoFree_PGC(ifofile->first_play_pgc);
-    free(ifofile->first_play_pgc);
-    ifofile->first_play_pgc = 0;
-  }
-}
-
-
-int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
-  tt_srpt_t *tt_srpt;
-  int i, info_length;
-
-  if(!ifofile)
-    return 0;
-
-  if(!ifofile->vmgi_mat)
-    return 0;
-
-  if(ifofile->vmgi_mat->tt_srpt == 0) /* mandatory */
-    return 0;
-
-  if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->tt_srpt * DVD_BLOCK_LEN))
-    return 0;
-
-  tt_srpt = (tt_srpt_t *)malloc(sizeof(tt_srpt_t));
-  if(!tt_srpt)
-    return 0;
-
-  ifofile->tt_srpt = tt_srpt;
-  
-  if(!(DVDReadBytes(ifofile->file, tt_srpt, TT_SRPT_SIZE))) {
-    fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
-    free(tt_srpt);
-    return 0;
-  }
-
-  B2N_16(tt_srpt->nr_of_srpts);
-  B2N_32(tt_srpt->last_byte);
-  
-  info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE;
-
-  tt_srpt->title = (title_info_t *)malloc(info_length); 
-  if(!tt_srpt->title) {
-    free(tt_srpt);
-    ifofile->tt_srpt = 0;
-    return 0;
-  }
-  if(!(DVDReadBytes(ifofile->file, tt_srpt->title, info_length))) {
-    fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
-    ifoFree_TT_SRPT(ifofile);
-    return 0;
-  }
-
-  for(i =  0; i < tt_srpt->nr_of_srpts; i++) {
-    B2N_16(tt_srpt->title[i].nr_of_ptts);
-    B2N_16(tt_srpt->title[i].parental_id);
-    B2N_32(tt_srpt->title[i].title_set_sector);
-  }
-  
-
-  CHECK_ZERO(tt_srpt->zero_1);
-  assert(tt_srpt->nr_of_srpts != 0);
-  assert(tt_srpt->nr_of_srpts < 100); // ??
-  assert((int)tt_srpt->nr_of_srpts * sizeof(title_info_t) <= info_length);
-  
-  for(i = 0; i < tt_srpt->nr_of_srpts; i++) {
-    assert(tt_srpt->title[i].pb_ty.zero_1 == 0);
-    assert(tt_srpt->title[i].nr_of_angles != 0);
-    assert(tt_srpt->title[i].nr_of_angles < 10);
-    //assert(tt_srpt->title[i].nr_of_ptts != 0);
-    // XXX: this assertion breaks Ghostbusters:
-    assert(tt_srpt->title[i].nr_of_ptts < 1000); // ??
-    assert(tt_srpt->title[i].title_set_nr != 0);
-    assert(tt_srpt->title[i].title_set_nr < 100); // ??
-    assert(tt_srpt->title[i].vts_ttn != 0);
-    assert(tt_srpt->title[i].vts_ttn < 100); // ??
-    //assert(tt_srpt->title[i].title_set_sector != 0);
-  }
-  
-  // Make this a function
-#if 0
-  if(memcmp((uint8_t *)tt_srpt->title + 
-            tt_srpt->nr_of_srpts * sizeof(title_info_t), 
-            my_friendly_zeros, 
-            info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t))) {
-    fprintf(stderr, "VMG_PTT_SRPT slack is != 0, ");
-    hexdump((uint8_t *)tt_srpt->title + 
-            tt_srpt->nr_of_srpts * sizeof(title_info_t), 
-            info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t));
-  }
-#endif
-
-  return 1;
-}
-
-
-void ifoFree_TT_SRPT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->tt_srpt) {
-    free(ifofile->tt_srpt->title);
-    free(ifofile->tt_srpt);
-    ifofile->tt_srpt = 0;
-  }
-}
-
-
-int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
-  vts_ptt_srpt_t *vts_ptt_srpt;
-  int info_length, i, j;
-  uint32_t *data;
-
-  if(!ifofile)
-    return 0;
-  
-  if(!ifofile->vtsi_mat)
-    return 0;
-
-  if(ifofile->vtsi_mat->vts_ptt_srpt == 0) /* mandatory */
-    return 0;
-    
-  if(!DVDFileSeek_(ifofile->file,
-                  ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN))
-    return 0;
-
-  vts_ptt_srpt = (vts_ptt_srpt_t *)malloc(sizeof(vts_ptt_srpt_t));
-  if(!vts_ptt_srpt)
-    return 0;
-
-  ifofile->vts_ptt_srpt = vts_ptt_srpt;
-
-  if(!(DVDReadBytes(ifofile->file, vts_ptt_srpt, VTS_PTT_SRPT_SIZE))) {
-    fprintf(stderr, "libdvdread: Unable to read PTT search table.\n");
-    free(vts_ptt_srpt);
-    return 0;
-  }
-
-  B2N_16(vts_ptt_srpt->nr_of_srpts);
-  B2N_32(vts_ptt_srpt->last_byte);
-
-  CHECK_ZERO(vts_ptt_srpt->zero_1);
-  assert(vts_ptt_srpt->nr_of_srpts != 0);
-  assert(vts_ptt_srpt->nr_of_srpts < 100); // ??
-  
-  info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE;
-  
-  data = (uint32_t *)malloc(info_length); 
-  if(!data) {
-    free(vts_ptt_srpt);
-    ifofile->vts_ptt_srpt = 0;
-    return 0;
-  }
-  if(!(DVDReadBytes(ifofile->file, data, info_length))) {
-    fprintf(stderr, "libdvdread: Unable to read PTT search table.\n");
-    free(vts_ptt_srpt);
-    free(data);
-    ifofile->vts_ptt_srpt = 0;
-    return 0;
-  }
-
-  for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
-    B2N_32(data[i]);
-    /* assert(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1);
-       Magic Knight Rayearth Daybreak is mastered very strange and has 
-       Titles with 0 PTTs. They all have a data[i] offsets beyond the end of
-       of the vts_ptt_srpt structure. */
-    assert(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1 + 4);
-  }
-  
-  vts_ptt_srpt->title = malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t));
-  if(!vts_ptt_srpt->title) {
-    free(vts_ptt_srpt);
-    free(data);
-    ifofile->vts_ptt_srpt = 0;
-    return 0;
-  }
-  for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
-    int n;
-    if(i < vts_ptt_srpt->nr_of_srpts - 1)
-      n = (data[i+1] - data[i]);
-    else
-      n = (vts_ptt_srpt->last_byte + 1 - data[i]);
-    /* assert(n > 0 && (n % 4) == 0);
-       Magic Knight Rayearth Daybreak is mastered very strange and has 
-       Titles with 0 PTTs. */
-    if(n < 0) n = 0;
-    assert(n % 4 == 0);
-    
-    vts_ptt_srpt->title[i].nr_of_ptts = n / 4;
-    vts_ptt_srpt->title[i].ptt = malloc(n * sizeof(ptt_info_t));
-    if(!vts_ptt_srpt->title[i].ptt) {
-      for(n = 0; n < i; n++)
-        free(vts_ptt_srpt->title[n].ptt);
-      free(vts_ptt_srpt);
-      free(data);
-      ifofile->vts_ptt_srpt = 0;
-      return 0;
-    }
-    for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
-      /* The assert placed here because of Magic Knight Rayearth Daybreak */
-      assert(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1);
-      vts_ptt_srpt->title[i].ptt[j].pgcn 
-        = *(uint16_t*)(((char *)data) + data[i] + 4*j - VTS_PTT_SRPT_SIZE);
-      vts_ptt_srpt->title[i].ptt[j].pgn 
-        = *(uint16_t*)(((char *)data) + data[i] + 4*j + 2 - VTS_PTT_SRPT_SIZE);
-    }
-  }
-  free(data);
-  
-  for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
-    for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
-      B2N_16(vts_ptt_srpt->title[i].ptt[j].pgcn);
-      B2N_16(vts_ptt_srpt->title[i].ptt[j].pgn);
-    }
-  }
-  
-  for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
-    assert(vts_ptt_srpt->title[i].nr_of_ptts < 1000); // ??
-    for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
-      assert(vts_ptt_srpt->title[i].ptt[j].pgcn != 0 );
-      assert(vts_ptt_srpt->title[i].ptt[j].pgcn < 1000); // ??
-      assert(vts_ptt_srpt->title[i].ptt[j].pgn != 0);
-      assert(vts_ptt_srpt->title[i].ptt[j].pgn < 100); // ??
-    }
-  }
-
-  return 1;
-}
-
-
-void ifoFree_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->vts_ptt_srpt) {
-    int i;
-    for(i = 0; i < ifofile->vts_ptt_srpt->nr_of_srpts; i++)
-      free(ifofile->vts_ptt_srpt->title[i].ptt);
-    free(ifofile->vts_ptt_srpt->title);
-    free(ifofile->vts_ptt_srpt);
-    ifofile->vts_ptt_srpt = 0;
-  }
-}
-
-
-int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) {
-  ptl_mait_t *ptl_mait;
-  int info_length;
-  unsigned int i;
-
-  if(!ifofile)
-    return 0;
-  
-  if(!ifofile->vmgi_mat)
-    return 0;
-  
-  if(ifofile->vmgi_mat->ptl_mait == 0)
-    return 1;
-
-  if(!DVDFileSeek_(ifofile->file, 
-                 ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN))
-    return 0;
-
-  ptl_mait = (ptl_mait_t *)malloc(sizeof(ptl_mait_t));
-  if(!ptl_mait)
-    return 0;
-
-  ifofile->ptl_mait = ptl_mait;
-
-  if(!(DVDReadBytes(ifofile->file, ptl_mait, PTL_MAIT_SIZE))) {
-    free(ptl_mait);
-    ifofile->ptl_mait = 0;
-    return 0;
-  }
-
-  B2N_16(ptl_mait->nr_of_countries);
-  B2N_16(ptl_mait->nr_of_vtss);
-  B2N_32(ptl_mait->last_byte);
-  
-  info_length = ptl_mait->last_byte + 1 - PTL_MAIT_SIZE;
-  
-  assert(ptl_mait->nr_of_countries != 0);
-  assert(ptl_mait->nr_of_countries < 100); // ??
-  assert(ptl_mait->nr_of_vtss != 0);
-  assert(ptl_mait->nr_of_vtss < 100); // ??  
-  assert(ptl_mait->nr_of_countries * PTL_MAIT_COUNTRY_SIZE <= info_length);
-  
-  /* Change this to read and 'translate' the tables too. 
-     I.e don't read so much here */
-  ptl_mait->countries = (ptl_mait_country_t *)malloc(info_length);
-  if(!ptl_mait->countries) {
-    free(ptl_mait);
-    ifofile->ptl_mait = 0;
-    return 0;
-  }
-  if(!(DVDReadBytes(ifofile->file, ptl_mait->countries, info_length))) {
-    fprintf(stderr, "libdvdread: Unable to read PTL_MAIT.\n");
-    ifoFree_PTL_MAIT(ifofile);
-    return 0;
-  }
-
-  for(i = 0; i < ptl_mait->nr_of_countries; i++) {
-    B2N_16(ptl_mait->countries[i].country_code);
-    B2N_16(ptl_mait->countries[i].pf_ptl_mai_start_byte);
-  }
-  
-  for(i = 0; i < ptl_mait->nr_of_countries; i++) {
-    CHECK_ZERO(ptl_mait->countries[i].zero_1);
-    CHECK_ZERO(ptl_mait->countries[i].zero_2);    
-    assert(ptl_mait->countries[i].pf_ptl_mai_start_byte + 
-           8 * (ptl_mait->nr_of_vtss + 1) * 2 <= ptl_mait->last_byte + 1);
-  }
-
-  return 1;
-}
-
-
-void ifoFree_PTL_MAIT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->ptl_mait) {
-    free(ifofile->ptl_mait->countries);
-    free(ifofile->ptl_mait);
-    ifofile->ptl_mait = 0;
-  }
-}
-
-int ifoRead_TITLE_C_ADT(ifo_handle_t *ifofile) {
-
-  if(!ifofile)
-    return 0;
-
-  if(!ifofile->vtsi_mat)
-    return 0;
-
-  if(ifofile->vtsi_mat->vts_c_adt == 0) /* mandatory */
-    return 0;
-
-  ifofile->vts_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
-  if(!ifofile->vts_c_adt)
-    return 0;
-
-  if(!ifoRead_C_ADT_internal(ifofile, ifofile->vts_c_adt, 
-                             ifofile->vtsi_mat->vts_c_adt)) {
-    free(ifofile->vts_c_adt);
-    ifofile->vts_c_adt = 0;
-    return 0;
-  }
-
-  return 1;
-}
-
-int ifoRead_C_ADT(ifo_handle_t *ifofile) {
-  unsigned int sector;
-
-  if(!ifofile)
-    return 0;
-  
-  if(ifofile->vmgi_mat) {
-    if(ifofile->vmgi_mat->vmgm_c_adt == 0)
-      return 1;
-    sector = ifofile->vmgi_mat->vmgm_c_adt;
-  } else if(ifofile->vtsi_mat) {
-    if(ifofile->vtsi_mat->vtsm_c_adt == 0)
-      return 1;
-    sector = ifofile->vtsi_mat->vtsm_c_adt;
-  } else {
-    return 0;
-  }
-  
-  ifofile->menu_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
-  if(!ifofile->menu_c_adt)
-    return 0;
-
-  if(!ifoRead_C_ADT_internal(ifofile, ifofile->menu_c_adt, sector)) {
-    free(ifofile->menu_c_adt);
-    ifofile->menu_c_adt = 0;
-    return 0;
-  }
-
-  return 1;
-}
-
-static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, 
-                                  c_adt_t *c_adt, unsigned int sector) {
-  int i, info_length;
-
-  if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, c_adt, C_ADT_SIZE)))
-    return 0;
-
-  B2N_16(c_adt->nr_of_vobs);
-  B2N_32(c_adt->last_byte);
-  
-  info_length = c_adt->last_byte + 1 - C_ADT_SIZE;
-  
-  CHECK_ZERO(c_adt->zero_1);
-  /* assert(c_adt->nr_of_vobs > 0);  
-     Magic Knight Rayearth Daybreak is mastered very strange and has 
-     Titles with a VOBS that has no cells. */
-  assert(info_length % sizeof(cell_adr_t) == 0);
-  assert(info_length / sizeof(cell_adr_t) >= c_adt->nr_of_vobs);
-  
-  c_adt->cell_adr_table = (cell_adr_t *)malloc(info_length); 
-  if(!c_adt->cell_adr_table)
-    return 0;
-
-  if(info_length && 
-     !(DVDReadBytes(ifofile->file, c_adt->cell_adr_table, info_length))) {
-    free(c_adt->cell_adr_table);
-    return 0;
-  }
-
-  for(i = 0; i < info_length/sizeof(cell_adr_t); i++) {
-    B2N_16(c_adt->cell_adr_table[i].vob_id);
-    B2N_32(c_adt->cell_adr_table[i].start_sector);
-    B2N_32(c_adt->cell_adr_table[i].last_sector);
-
-    CHECK_ZERO(c_adt->cell_adr_table[i].zero_1);
-    assert(c_adt->cell_adr_table[i].vob_id > 0);
-    assert(c_adt->cell_adr_table[i].vob_id <= c_adt->nr_of_vobs);
-    assert(c_adt->cell_adr_table[i].cell_id > 0);
-    assert(c_adt->cell_adr_table[i].start_sector < 
-           c_adt->cell_adr_table[i].last_sector);
-  }
-
-  return 1;
-}
-
-
-static void ifoFree_C_ADT_internal(c_adt_t *c_adt) {
-  if(c_adt) {
-    free(c_adt->cell_adr_table);
-    free(c_adt);
-  }
-}
-
-void ifoFree_C_ADT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  ifoFree_C_ADT_internal(ifofile->menu_c_adt);
-  ifofile->menu_c_adt = 0;
-}
-
-void ifoFree_TITLE_C_ADT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  ifoFree_C_ADT_internal(ifofile->vts_c_adt);
-  ifofile->vts_c_adt = 0;
-}
-
-int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return 0;
-
-  if(!ifofile->vtsi_mat)
-    return 0;
-  
-  if(ifofile->vtsi_mat->vts_vobu_admap == 0) /* mandatory */
-    return 0;
-  
-  ifofile->vts_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
-  if(!ifofile->vts_vobu_admap)
-    return 0;
-
-  if(!ifoRead_VOBU_ADMAP_internal(ifofile, ifofile->vts_vobu_admap,
-                                  ifofile->vtsi_mat->vts_vobu_admap)) {
-    free(ifofile->vts_vobu_admap);
-    ifofile->vts_vobu_admap = 0;
-    return 0;
-  }
-
-  return 1;
-}
-
-int ifoRead_VOBU_ADMAP(ifo_handle_t *ifofile) {
-  unsigned int sector;
-
-  if(!ifofile)
-    return 0;
-     
-  if(ifofile->vmgi_mat) {
-    if(ifofile->vmgi_mat->vmgm_vobu_admap == 0)
-      return 1;
-    sector = ifofile->vmgi_mat->vmgm_vobu_admap;
-  } else if(ifofile->vtsi_mat) {
-    if(ifofile->vtsi_mat->vtsm_vobu_admap == 0)
-      return 1;
-    sector = ifofile->vtsi_mat->vtsm_vobu_admap;
-  } else {
-    return 0;
-  }
-  
-  ifofile->menu_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
-  if(!ifofile->menu_vobu_admap)
-    return 0;
-  
-  if(!ifoRead_VOBU_ADMAP_internal(ifofile, ifofile->menu_vobu_admap, sector)) {
-    free(ifofile->menu_vobu_admap);
-    ifofile->menu_vobu_admap = 0;
-    return 0;
-  }
-
-  return 1;
-}
-
-static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile, 
-                                       vobu_admap_t *vobu_admap, 
-                                      unsigned int sector) {
-  unsigned int i;
-  int info_length;
-
-  if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, vobu_admap, VOBU_ADMAP_SIZE)))
-    return 0;
-
-  B2N_32(vobu_admap->last_byte);
-  
-  info_length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE;
-  /* assert(info_length > 0);
-     Magic Knight Rayearth Daybreak is mastered very strange and has 
-     Titles with a VOBS that has no VOBUs. */
-  assert(info_length % sizeof(uint32_t) == 0);
-  
-  vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length); 
-  if(!vobu_admap->vobu_start_sectors) {
-    return 0;
-  }
-  if(info_length && 
-     !(DVDReadBytes(ifofile->file, 
-                   vobu_admap->vobu_start_sectors, info_length))) {
-    free(vobu_admap->vobu_start_sectors);
-    return 0;
-  }
-
-  for(i = 0; i < info_length/sizeof(uint32_t); i++)
-    B2N_32(vobu_admap->vobu_start_sectors[i]);
-
-  return 1;
-}
-
-
-static void ifoFree_VOBU_ADMAP_internal(vobu_admap_t *vobu_admap) {
-  if(vobu_admap) {
-    free(vobu_admap->vobu_start_sectors);
-    free(vobu_admap);
-  }
-}
-
-void ifoFree_VOBU_ADMAP(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  ifoFree_VOBU_ADMAP_internal(ifofile->menu_vobu_admap);
-  ifofile->menu_vobu_admap = 0;
-}
-
-void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  ifoFree_VOBU_ADMAP_internal(ifofile->vts_vobu_admap);
-  ifofile->vts_vobu_admap = 0;
-}
-
-int ifoRead_PGCIT(ifo_handle_t *ifofile) {
-
-  if(!ifofile)
-    return 0;
-  
-  if(!ifofile->vtsi_mat)
-    return 0;
-  
-  if(ifofile->vtsi_mat->vts_pgcit == 0) /* mandatory */
-    return 0;
-  
-  ifofile->vts_pgcit = (pgcit_t *)malloc(sizeof(pgcit_t));
-  if(!ifofile->vts_pgcit)
-    return 0;
-
-  if(!ifoRead_PGCIT_internal(ifofile, ifofile->vts_pgcit, 
-                             ifofile->vtsi_mat->vts_pgcit * DVD_BLOCK_LEN)) {
-    free(ifofile->vts_pgcit);
-    ifofile->vts_pgcit = 0;
-    return 0;
-  }
-
-  return 1;
-}
-
-static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit, 
-                                  unsigned int offset) {
-  int i, info_length;
-  uint8_t *data, *ptr;
-  
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, pgcit, PGCIT_SIZE)))
-    return 0;
-
-  B2N_16(pgcit->nr_of_pgci_srp);
-  B2N_32(pgcit->last_byte);
-  
-  CHECK_ZERO(pgcit->zero_1);
-  /* assert(pgcit->nr_of_pgci_srp != 0);
-     Magic Knight Rayearth Daybreak is mastered very strange and has 
-     Titles with 0 PTTs. */
-  assert(pgcit->nr_of_pgci_srp < 10000); // ?? seen max of 1338
-  
-  info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE;
-  data = malloc(info_length);
-  if(!data)
-    return 0;
-
-  if(info_length && !(DVDReadBytes(ifofile->file, data, info_length))) {
-    free(data);
-    return 0;
-  }
-
-  pgcit->pgci_srp = malloc(pgcit->nr_of_pgci_srp * sizeof(pgci_srp_t));
-  if(!pgcit->pgci_srp) {
-    free(data);
-    return 0;
-  }
-  ptr = data;
-  for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
-    memcpy(&pgcit->pgci_srp[i], ptr, PGCI_LU_SIZE);
-    ptr += PGCI_LU_SIZE;
-    B2N_16(pgcit->pgci_srp[i].ptl_id_mask);
-    B2N_32(pgcit->pgci_srp[i].pgc_start_byte);
-    assert(pgcit->pgci_srp[i].unknown1 == 0);
-  }
-  free(data);
-  
-  for(i = 0; i < pgcit->nr_of_pgci_srp; i++)
-    assert(pgcit->pgci_srp[i].pgc_start_byte + PGC_SIZE <= pgcit->last_byte+1);
-  
-  for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
-    pgcit->pgci_srp[i].pgc = malloc(sizeof(pgc_t));
-    if(!pgcit->pgci_srp[i].pgc) {
-      int j;
-      for(j = 0; j < i; j++) {
-        ifoFree_PGC(pgcit->pgci_srp[j].pgc);
-        free(pgcit->pgci_srp[j].pgc);
-      }
-      return 0;
-    }
-    if(!ifoRead_PGC(ifofile, pgcit->pgci_srp[i].pgc, 
-                    offset + pgcit->pgci_srp[i].pgc_start_byte)) {
-      int j;
-      for(j = 0; j < i; j++) {
-        ifoFree_PGC(pgcit->pgci_srp[j].pgc);
-        free(pgcit->pgci_srp[j].pgc);
-      }
-      free(pgcit->pgci_srp);
-      return 0;
-    }
-  }
-
-  return 1;
-}
-
-static void ifoFree_PGCIT_internal(pgcit_t *pgcit) {
-  if(pgcit) {
-    int i;
-    for(i = 0; i < pgcit->nr_of_pgci_srp; i++)
-      ifoFree_PGC(pgcit->pgci_srp[i].pgc);
-    free(pgcit->pgci_srp);
-  }
-}
-
-void ifoFree_PGCIT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->vts_pgcit) {
-    ifoFree_PGCIT_internal(ifofile->vts_pgcit);
-    free(ifofile->vts_pgcit);
-    ifofile->vts_pgcit = 0;
-  }
-}
-
-
-int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
-  pgci_ut_t *pgci_ut;
-  unsigned int sector;
-  unsigned int i;  
-  int info_length;
-  uint8_t *data, *ptr;
-
-  if(!ifofile)
-    return 0;
-  
-  if(ifofile->vmgi_mat) {
-    if(ifofile->vmgi_mat->vmgm_pgci_ut == 0)
-      return 1;
-    sector = ifofile->vmgi_mat->vmgm_pgci_ut;
-  } else if(ifofile->vtsi_mat) {
-    if(ifofile->vtsi_mat->vtsm_pgci_ut == 0)
-      return 1;
-    sector = ifofile->vtsi_mat->vtsm_pgci_ut;
-  } else {
-    return 0;
-  }
-  
-  ifofile->pgci_ut = (pgci_ut_t *)malloc(sizeof(pgci_ut_t));
-  if(!ifofile->pgci_ut)
-    return 0;
-  
-  if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) {
-    free(ifofile->pgci_ut);
-    ifofile->pgci_ut = 0;
-    return 0;
-  }
-  
-  if(!(DVDReadBytes(ifofile->file, ifofile->pgci_ut, PGCI_UT_SIZE))) {
-    free(ifofile->pgci_ut);
-    ifofile->pgci_ut = 0;
-    return 0;
-  }
-  
-  pgci_ut = ifofile->pgci_ut;
-  
-  B2N_16(pgci_ut->nr_of_lus);
-  B2N_32(pgci_ut->last_byte);
-  
-  CHECK_ZERO(pgci_ut->zero_1);
-  assert(pgci_ut->nr_of_lus != 0);
-  assert(pgci_ut->nr_of_lus < 100); // ?? 3-4 ?
-  assert((uint32_t)pgci_ut->nr_of_lus * PGCI_LU_SIZE < pgci_ut->last_byte);
-
-  info_length = pgci_ut->nr_of_lus * PGCI_LU_SIZE;
-  data = malloc(info_length);
-  if(!data) {
-    free(pgci_ut);
-    ifofile->pgci_ut = 0;
-    return 0;
-  }
-  if(!(DVDReadBytes(ifofile->file, data, info_length))) {
-    free(data);
-    free(pgci_ut);
-    ifofile->pgci_ut = 0;
-    return 0;
-  }
-
-  pgci_ut->lu = malloc(pgci_ut->nr_of_lus * sizeof(pgci_lu_t));
-  if(!pgci_ut->lu) {
-    free(data);
-    free(pgci_ut);
-    ifofile->pgci_ut = 0;
-   return 0;
-  }
-  ptr = data;
-  for(i = 0; i < pgci_ut->nr_of_lus; i++) {
-    memcpy(&pgci_ut->lu[i], ptr, PGCI_LU_SIZE);
-    ptr += PGCI_LU_SIZE;
-    B2N_16(pgci_ut->lu[i].lang_code); 
-    B2N_32(pgci_ut->lu[i].lang_start_byte); 
-  }
-  free(data);
-  
-  for(i = 0; i < pgci_ut->nr_of_lus; i++) {
-    CHECK_ZERO(pgci_ut->lu[i].zero_1);
-    // Maybe this is only defined for v1.1 and later titles?
-    /* If the bits in 'lu[i].exists' are enumerated abcd efgh then:
-            VTS_x_yy.IFO        VIDEO_TS.IFO
-       a == 0x83 "Root"         0x82 "Title"
-       b == 0x84 "Subpicture"
-       c == 0x85 "Audio"
-       d == 0x86 "Angle"
-       e == 0x87 "PTT"
-    */
-    assert((pgci_ut->lu[i].exists & 0x07) == 0);
-  }
-
-  for(i = 0; i < pgci_ut->nr_of_lus; i++) {
-    pgci_ut->lu[i].pgcit = malloc(sizeof(pgcit_t));
-    if(!pgci_ut->lu[i].pgcit) {
-      unsigned int j;
-      for(j = 0; j < i; j++) {
-        ifoFree_PGCIT_internal(pgci_ut->lu[j].pgcit);
-        free(pgci_ut->lu[j].pgcit);
-      }
-      free(pgci_ut->lu);
-      free(pgci_ut);
-      ifofile->pgci_ut = 0;
-      return 0;
-    }
-    if(!ifoRead_PGCIT_internal(ifofile, pgci_ut->lu[i].pgcit, 
-                               sector * DVD_BLOCK_LEN 
-                               + pgci_ut->lu[i].lang_start_byte)) {
-      unsigned int j;
-      for(j = 0; j < i; j++) {
-        ifoFree_PGCIT_internal(pgci_ut->lu[j].pgcit);
-        free(pgci_ut->lu[j].pgcit);
-      }
-      free(pgci_ut->lu[i].pgcit);
-      free(pgci_ut->lu);
-      free(pgci_ut);
-      ifofile->pgci_ut = 0;
-      return 0;
-    }
-    // FIXME: Iterate and verify that all menus that should exists accordingly
-    //        to pgci_ut->lu[i].exists really do?
-  }
-
-  return 1;
-}
-
-
-void ifoFree_PGCI_UT(ifo_handle_t *ifofile) {
-  unsigned int i;
-
-  if(!ifofile)
-    return;
-  
-  if(ifofile->pgci_ut) {
-    for(i = 0; i < ifofile->pgci_ut->nr_of_lus; i++) {
-      ifoFree_PGCIT_internal(ifofile->pgci_ut->lu[i].pgcit);
-      free(ifofile->pgci_ut->lu[i].pgcit);
-    }
-    free(ifofile->pgci_ut->lu);
-    free(ifofile->pgci_ut);
-    ifofile->pgci_ut = 0;
-  }
-}
-
-static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile, 
-                                  vts_attributes_t *vts_attributes, 
-                                  unsigned int offset) {
-  unsigned int i;
-
-  if(!DVDFileSeek_(ifofile->file, offset))
-    return 0;
-
-  if(!(DVDReadBytes(ifofile->file, vts_attributes, sizeof(vts_attributes_t))))
-    return 0;
-
-  B2N_32(vts_attributes->last_byte);
-  B2N_32(vts_attributes->vts_cat);
-  B2N_16(vts_attributes->vtsm_audio_attr.lang_code);
-  B2N_16(vts_attributes->vtsm_subp_attr.lang_code);
-  for(i = 0; i < 8; i++)
-    B2N_16(vts_attributes->vtstt_audio_attr[i].lang_code);
-  for(i = 0; i < 32; i++)
-    B2N_16(vts_attributes->vtstt_subp_attr[i].lang_code);
-  
-  CHECK_ZERO(vts_attributes->zero_1);
-  CHECK_ZERO(vts_attributes->zero_2);
-  CHECK_ZERO(vts_attributes->zero_3);
-  CHECK_ZERO(vts_attributes->zero_4);
-  CHECK_ZERO(vts_attributes->zero_5);
-  CHECK_ZERO(vts_attributes->zero_6);
-  CHECK_ZERO(vts_attributes->zero_7);
-  assert(vts_attributes->nr_of_vtsm_audio_streams <= 1);
-  assert(vts_attributes->nr_of_vtsm_subp_streams <= 1);
-  assert(vts_attributes->nr_of_vtstt_audio_streams <= 8);
-  for(i = vts_attributes->nr_of_vtstt_audio_streams; i < 8; i++)
-    CHECK_ZERO(vts_attributes->vtstt_audio_attr[i]);
-  assert(vts_attributes->nr_of_vtstt_subp_streams <= 32);
-  {
-    int nr_coded;
-    assert(vts_attributes->last_byte + 1 - VTS_ATTRIBUTES_MIN_SIZE >= 0);  
-    nr_coded = (vts_attributes->last_byte + 1 - VTS_ATTRIBUTES_MIN_SIZE)/6;
-    // This is often nr_coded = 70, how do you know how many there really are?
-    if(nr_coded > 32) { // We haven't read more from disk/file anyway
-      nr_coded = 32;
-    }
-    assert(vts_attributes->nr_of_vtstt_subp_streams <= nr_coded);
-    for(i = vts_attributes->nr_of_vtstt_subp_streams; i < nr_coded; i++)
-      CHECK_ZERO(vts_attributes->vtstt_subp_attr[i]);
-  }
-
-  return 1;
-}
-
-
-
-int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) {
-  vts_atrt_t *vts_atrt;
-  unsigned int i, info_length, sector;
-  uint32_t *data;
-
-  if(!ifofile)
-    return 0;
-  
-  if(!ifofile->vmgi_mat)
-    return 0;
-  
-  if(ifofile->vmgi_mat->vts_atrt == 0) /* mandatory */
-    return 0;
-  
-  sector = ifofile->vmgi_mat->vts_atrt;
-  if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
-    return 0;
-
-  vts_atrt = (vts_atrt_t *)malloc(sizeof(vts_atrt_t));
-  if(!vts_atrt)
-    return 0;
-
-  ifofile->vts_atrt = vts_atrt;
-  
-  if(!(DVDReadBytes(ifofile->file, vts_atrt, VTS_ATRT_SIZE))) {
-    free(vts_atrt);
-    ifofile->vts_atrt = 0;
-    return 0;
-  }
-
-  B2N_16(vts_atrt->nr_of_vtss);
-  B2N_32(vts_atrt->last_byte);
-
-  CHECK_ZERO(vts_atrt->zero_1);
-  assert(vts_atrt->nr_of_vtss != 0);
-  assert(vts_atrt->nr_of_vtss < 100); //??
-  assert((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) + 
-         VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
-
-  info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t);
-  data = (uint32_t *)malloc(info_length);
-  if(!data) {
-    free(vts_atrt);
-    ifofile->vts_atrt = 0;
-    return 0;
-  }
-  if(!(DVDReadBytes(ifofile->file, data, info_length))) {
-    free(data);
-    free(vts_atrt);
-    ifofile->vts_atrt = 0;
-    return 0;
-  }
-  
-  for(i = 0; i < vts_atrt->nr_of_vtss; i++) {
-    B2N_32(data[i]);
-    assert(data[i] + VTS_ATTRIBUTES_MIN_SIZE < vts_atrt->last_byte + 1);
-  }
-  
-  info_length = vts_atrt->nr_of_vtss * sizeof(vts_attributes_t);
-  vts_atrt->vts = (vts_attributes_t *)malloc(info_length);
-  if(!vts_atrt->vts) {
-    free(data);
-    free(vts_atrt);
-    ifofile->vts_atrt = 0;
-    return 0;
-  }
-  for(i = 0; i < vts_atrt->nr_of_vtss; i++) {
-    unsigned int offset = data[i];
-    if(!ifoRead_VTS_ATTRIBUTES(ifofile, &(vts_atrt->vts[i]),
-                               (sector * DVD_BLOCK_LEN) + offset)) {
-      free(data);
-      free(vts_atrt);
-      ifofile->vts_atrt = 0;
-      return 0;
-    }
-
-    // This assert cant be in ifoRead_VTS_ATTRIBUTES
-    assert(offset + vts_atrt->vts[i].last_byte <= vts_atrt->last_byte + 1);
-    // Is this check correct?
-  }
-  free(data);
-
-  return 1;
-}
-
-
-void ifoFree_VTS_ATRT(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->vts_atrt) {
-    free(ifofile->vts_atrt->vts);
-    free(ifofile->vts_atrt);
-    ifofile->vts_atrt = 0;
-  }
-}
-
-
-int ifoRead_TXTDT_MGI(ifo_handle_t *ifofile) {
-  txtdt_mgi_t *txtdt_mgi;
-
-  if(!ifofile)
-    return 0;
-  
-  if(!ifofile->vmgi_mat)
-    return 0;
-  /* Return successfully if there is nothing to read. */ 
-  if(ifofile->vmgi_mat->txtdt_mgi == 0)
-    return 1;
-
-  if(!DVDFileSeek_(ifofile->file, 
-                  ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN))
-    return 0;
-  
-  txtdt_mgi = (txtdt_mgi_t *)malloc(sizeof(txtdt_mgi_t));
-  if(!txtdt_mgi) {
-    return 0;
-  }
-  ifofile->txtdt_mgi = txtdt_mgi;
-
-  if(!(DVDReadBytes(ifofile->file, txtdt_mgi, TXTDT_MGI_SIZE))) {
-    fprintf(stderr, "libdvdread: Unable to read TXTDT_MGI.\n");
-    free(txtdt_mgi);
-    ifofile->txtdt_mgi = 0;
-    return 0;
-  }
-
-  // fprintf(stderr, "-- Not done yet --\n");
-  return 1;
-}
-
-void ifoFree_TXTDT_MGI(ifo_handle_t *ifofile) {
-  if(!ifofile)
-    return;
-  
-  if(ifofile->txtdt_mgi) {
-    free(ifofile->txtdt_mgi);
-    ifofile->txtdt_mgi = 0;
-  }
-}
-
diff --git a/extras/libdvdread/ifo_read.h b/extras/libdvdread/ifo_read.h
deleted file mode 100644 (file)
index f636881..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Copyright (C) 2000 Björn Englund <d4bjorn@dtek.chalmers.se>,
- *                    Håkan Hjort <d95hjort@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
- */
-
-#ifndef IFO_READ_H_INCLUDED
-#define IFO_READ_H_INCLUDED
-
-#include "ifo_types.h"
-#include "dvd_reader.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Opens an IFO and reads in all the data for the IFO file corresponding to the
- * given title.  If title 0 is given, the video manager IFO file is read.
- * Returns a handle to a completely parsed structure.
- */
-ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title);
-
-/**
- * Opens an IFO and reads in _only_ the vmgi_mat data.  This call can be used
- * together with the calls below to read in each segment of the IFO file on
- * demand.
- */
-ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd);
-
-/**
- * Opens an IFO and reads in _only_ the vtsi_mat data.  This call can be used
- * together with the calls below to read in each segment of the IFO file on
- * demand.
- */
-ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title);
-
-/**
- * Cleans up the IFO information.  This will free all data allocated for the
- * substructures.
- */
-void ifoClose(ifo_handle_t *ifofile);
-
-/**
- * The following functions are for reading only part of the VMGI/VTSI files.
- * Returns 1 if the data was successfully read and 0 on error.
- */
-
-/**
- * Read in the Parental Management Information table, filling the
- * ifofile->ptl_mait structure and its substructures.  This data is only
- * located in the video manager information file.  This fills the
- * ifofile->ptl_mait structure and all its substructures.
- */
-int ifoRead_PTL_MAIT(ifo_handle_t *ifofile);
-
-/**
- * Read in the attribute table for the main menu vob, filling the
- * ifofile->vts_atrt structure and its substructures.  Only located in the
- * video manager information file.  This fills in the ifofile->vts_atrt
- * structure and all its substructures.
- */
-int ifoRead_VTS_ATRT(ifo_handle_t *ifofile);
-
-/**
- * Reads the title info for the main menu, filling the ifofile->tt_srpt
- * structure and its substructures.  This data is only located in the video
- * manager information file.  This structure is mandatory in the IFO file.
- */
-int ifoRead_TT_SRPT(ifo_handle_t *ifofile);
-
-/**
- * Reads in the part of title search pointer table, filling the
- * ifofile->vts_ptt_srpt structure and its substructures.  This data is only
- * located in the video title set information file.  This structure is
- * mandatory, and must be included in the VTSI file.
- */
-int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile);
-
-/**
- * Reads in the first play program chain data, filling the
- * ifofile->first_play_pgc structure.  This data is only located in the video
- * manager information file.  This structure is mandatory, and must be included
- * in the VMGI file.
- */
-int ifoRead_FP_PGC(ifo_handle_t *ifofile);
-
-/**
- * Reads in the program chain information table for the video title set.  Fills
- * in the ifofile->vts_pgcit structure and its substructures, which includes
- * the data for each program chain in the set.  This data is only located in
- * the video title set information file.  This structure is mandatory, and must
- * be included in the VTSI file.
- */
-int ifoRead_PGCIT(ifo_handle_t *ifofile);
-
-/**
- * Reads in the menu PGCI unit table for the menu VOB.  For the video manager,
- * this corresponds to the VIDEO_TS.VOB file, and for each title set, this
- * corresponds to the VTS_XX_0.VOB file.  This data is located in both the
- * video manager and video title set information files.  For VMGI files, this
- * fills the ifofile->vmgi_pgci_ut structure and all its substructures.  For
- * VTSI files, this fills the ifofile->vtsm_pgci_ut structure.
- */
-int ifoRead_PGCI_UT(ifo_handle_t *ifofile);
-
-/**
- * Reads in the cell address table for the menu VOB.  For the video manager,
- * this corresponds to the VIDEO_TS.VOB file, and for each title set, this
- * corresponds to the VTS_XX_0.VOB file.  This data is located in both the
- * video manager and video title set information files.  For VMGI files, this
- * fills the ifofile->vmgm_c_adt structure and all its substructures.  For VTSI
- * files, this fills the ifofile->vtsm_c_adt structure.
- */
-int ifoRead_C_ADT(ifo_handle_t *ifofile);
-
-/**
- * Reads in the cell address table for the video title set corresponding to
- * this IFO file.  This data is only located in the video title set information
- * file.  This structure is mandatory, and must be included in the VTSI file.
- * This call fills the ifofile->vts_c_adt structure and its substructures.
- */
-int ifoRead_TITLE_C_ADT(ifo_handle_t *ifofile);
-
-/**
- * Reads in the VOBU address map for the menu VOB.  For the video manager, this
- * corresponds to the VIDEO_TS.VOB file, and for each title set, this
- * corresponds to the VTS_XX_0.VOB file.  This data is located in both the
- * video manager and video title set information files.  For VMGI files, this
- * fills the ifofile->vmgm_vobu_admap structure and all its substructures.  For
- * VTSI files, this fills the ifofile->vtsm_vobu_admap structure.
- */
-int ifoRead_VOBU_ADMAP(ifo_handle_t *ifofile);
-
-/**
- * Reads in the VOBU address map for the associated video title set.  This data
- * is only located in the video title set information file.  This structure is
- * mandatory, and must be included in the VTSI file.  Fills the
- * ifofile->vts_vobu_admap structure and its substructures.
- */
-int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile);
-
-/**
- * Reads in the text data strings for the DVD.  Fills the ifofile->txtdt_mgi
- * structure and all its substructures.  This data is only located in the video
- * manager information file.  This structure is mandatory, and must be included
- * in the VMGI file.
- */
-int ifoRead_TXTDT_MGI(ifo_handle_t *ifofile);
-
-/**
- * The following functions are used for freeing parsed sections of the
- * ifo_handle_t structure and the allocated substructures.  The free calls
- * below are safe:  they will not mind if you attempt to free part of an IFO
- * file which was not read in or which does not exist.
- */
-void ifoFree_PTL_MAIT(ifo_handle_t *ifofile);
-void ifoFree_VTS_ATRT(ifo_handle_t *ifofile);
-void ifoFree_TT_SRPT(ifo_handle_t *ifofile);
-void ifoFree_VTS_PTT_SRPT(ifo_handle_t *ifofile);
-void ifoFree_FP_PGC(ifo_handle_t *ifofile);
-void ifoFree_PGCIT(ifo_handle_t *ifofile);
-void ifoFree_PGCI_UT(ifo_handle_t *ifofile);
-void ifoFree_C_ADT(ifo_handle_t *ifofile);
-void ifoFree_TITLE_C_ADT(ifo_handle_t *ifofile);
-void ifoFree_VOBU_ADMAP(ifo_handle_t *ifofile);
-void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile);
-void ifoFree_TXTDT_MGI(ifo_handle_t *ifofile);
-
-#ifdef __cplusplus
-};
-#endif
-#endif /* IFO_READ_H_INCLUDED */
diff --git a/extras/libdvdread/ifo_types.h b/extras/libdvdread/ifo_types.h
deleted file mode 100644 (file)
index 5c6a825..0000000
+++ /dev/null
@@ -1,747 +0,0 @@
-/**
- * Copyright (C) 2000 Björn Englund <d4bjorn@dtek.chalmers.se>,
- *                    Håkan Hjort <d95hjort@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
- */
-
-#ifndef IFO_TYPES_H_INCLUDED
-#define IFO_TYPES_H_INCLUDED
-
-#include <inttypes.h>
-#include "dvd_reader.h"
-
-
-#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN 
-#undef PRAGMA_PACK_END
-
-#if defined(__GNUC__)
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#define PRAGMA_PACK 0
-#endif
-#endif
-
-#if !defined(ATTRIBUTE_PACKED)
-#define ATTRIBUTE_PACKED
-#define PRAGMA_PACK 1
-#endif
-
-#if PRAGMA_PACK
-#pragma pack(1)
-#endif
-
-
-/**
- * Common
- *
- * The following structures are used in both the VMGI and VTSI.
- */
-
-
-/**
- * DVD Time Information.
- */
-typedef struct {
-  uint8_t hour;
-  uint8_t minute;
-  uint8_t second;
-  uint8_t frame_u; // The two high bits are the frame rate.
-} ATTRIBUTE_PACKED dvd_time_t;
-
-/**
- * Type to store per-command data.
- */
-typedef struct {
-  uint8_t bytes[8];
-} ATTRIBUTE_PACKED vm_cmd_t;
-#define COMMAND_DATA_SIZE 8
-
-
-/**
- * Video Attributes.
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
-  unsigned int mpeg_version         : 2;
-  unsigned int video_format         : 2;
-  unsigned int display_aspect_ratio : 2;
-  unsigned int permitted_df         : 2;
-  
-  unsigned int line21_cc_1          : 1;
-  unsigned int line21_cc_2          : 1;
-  unsigned int unknown1             : 2;
-  
-  unsigned int picture_size         : 2;
-  unsigned int letterboxed          : 1;
-  unsigned int film_mode            : 1;
-#else
-  unsigned int permitted_df         : 2;
-  unsigned int display_aspect_ratio : 2;
-  unsigned int video_format         : 2;
-  unsigned int mpeg_version         : 2;
-  
-  unsigned int film_mode            : 1;
-  unsigned int letterboxed          : 1;
-  unsigned int picture_size         : 2;
-  
-  unsigned int unknown1             : 2;
-  unsigned int line21_cc_2          : 1;
-  unsigned int line21_cc_1          : 1;
-#endif
-} ATTRIBUTE_PACKED video_attr_t;
-
-/**
- * Audio Attributes. (Incomplete/Wrong?)
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
-  unsigned int audio_format           : 3;
-  unsigned int multichannel_extension : 1;
-  unsigned int lang_type              : 2;
-  unsigned int application_mode       : 2;
-  
-  unsigned int quantization           : 2;
-  unsigned int sample_frequency       : 2;
-  unsigned int unknown1               : 1;
-  unsigned int channels               : 3;
-#else
-  unsigned int application_mode       : 2;
-  unsigned int lang_type              : 2;
-  unsigned int multichannel_extension : 1;
-  unsigned int audio_format           : 3;
-  
-  unsigned int channels               : 3;
-  unsigned int unknown1               : 1;
-  unsigned int sample_frequency       : 2;
-  unsigned int quantization           : 2;
-#endif
-  uint16_t lang_code;
-  uint8_t  lang_code2; // ??
-  uint8_t  lang_extension;
-  uint16_t unknown2;
-} ATTRIBUTE_PACKED audio_attr_t;
-
-/**
- * Subpicture Attributes.(Incomplete/Wrong)
- */
-typedef struct {
-  /*
-   * type: 0 not specified
-   *       1 language
-   *       2 other
-   * coding mode: 0 run length
-   *              1 extended
-   *              2 other
-   * language: indicates language if type == 1
-   * lang extension: if type == 1 contains the lang extension
-   */
-  uint8_t type;
-  uint8_t zero1;
-  uint16_t lang_code;
-  uint8_t lang_extension;
-  uint8_t zero2;
-} ATTRIBUTE_PACKED subp_attr_t;
-
-
-
-/**
- * PGC Command Table.
- */ 
-typedef struct {
-  uint16_t nr_of_pre;
-  uint16_t nr_of_post;
-  uint16_t nr_of_cell;
-  uint16_t zero_1;
-  vm_cmd_t *pre_cmds;
-  vm_cmd_t *post_cmds;
-  vm_cmd_t *cell_cmds;
-} ATTRIBUTE_PACKED pgc_command_tbl_t;
-#define PGC_COMMAND_TBL_SIZE 8
-
-/**
- * PGC Program Map
- */
-typedef uint8_t pgc_program_map_t; 
-
-/**
- * Cell Playback Information.
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
-  unsigned int block_mode       : 2;
-  unsigned int block_type       : 2;
-  unsigned int seamless_play    : 1;
-  unsigned int interleaved      : 1;
-  unsigned int stc_discontinuity: 1;
-  unsigned int seamless_angle   : 1;
-  
-  unsigned int unknown1         : 1;
-  unsigned int restricted       : 1;
-  unsigned int unknown2         : 6;
-#else
-  unsigned int seamless_angle   : 1;
-  unsigned int stc_discontinuity: 1;
-  unsigned int interleaved      : 1;
-  unsigned int seamless_play    : 1;
-  unsigned int block_type       : 2;
-  unsigned int block_mode       : 2;
-  
-  unsigned int unknown2         : 6;
-  unsigned int restricted       : 1;
-  unsigned int unknown1         : 1;
-#endif
-  uint8_t still_time;
-  uint8_t cell_cmd_nr;
-  dvd_time_t playback_time;
-  uint32_t first_sector;
-  uint32_t first_ilvu_end_sector;
-  uint32_t last_vobu_start_sector;
-  uint32_t last_sector;
-} ATTRIBUTE_PACKED cell_playback_t;
-
-#define BLOCK_TYPE_NONE         0x0
-#define BLOCK_TYPE_ANGLE_BLOCK  0x1
-
-#define BLOCK_MODE_NOT_IN_BLOCK 0x0
-#define BLOCK_MODE_FIRST_CELL   0x1
-#define BLOCK_MODE_IN_BLOCK     0x2
-#define BLOCK_MODE_LAST_CELL    0x3
-
-/**
- * Cell Position Information.
- */
-typedef struct {
-  uint16_t vob_id_nr;
-  uint8_t  zero_1;
-  uint8_t  cell_nr;
-} ATTRIBUTE_PACKED cell_position_t;
-
-/**
- * User Operations.
- */
-typedef struct {
-#ifdef WORDS_BIGENDIAN
-  unsigned int zero                           : 7; // 25-31
-  unsigned int video_pres_mode_change         : 1; // 24
-  
-  unsigned int karaoke_audio_pres_mode_change : 1; // 23
-  unsigned int angle_change                   : 1; // 22
-  unsigned int subpic_stream_change           : 1; // 21
-  unsigned int audio_stream_change            : 1; // 20
-  unsigned int pause_on                       : 1; // 19
-  unsigned int still_off                      : 1; // 18
-  unsigned int button_select_or_activate      : 1; // 17
-  unsigned int resume                         : 1; // 16
-  
-  unsigned int chapter_menu_call              : 1; // 15
-  unsigned int angle_menu_call                : 1; // 14
-  unsigned int audio_menu_call                : 1; // 13
-  unsigned int subpic_menu_call               : 1; // 12
-  unsigned int root_menu_call                 : 1; // 11
-  unsigned int title_menu_call                : 1; // 10
-  unsigned int backward_scan                  : 1; // 9
-  unsigned int forward_scan                   : 1; // 8
-  
-  unsigned int next_pg_search                 : 1; // 7
-  unsigned int prev_or_top_pg_search          : 1; // 6
-  unsigned int time_or_chapter_search         : 1; // 5
-  unsigned int go_up                          : 1; // 4
-  unsigned int stop                           : 1; // 3
-  unsigned int title_play                     : 1; // 2
-  unsigned int chapter_search_or_play         : 1; // 1
-  unsigned int title_or_time_play             : 1; // 0
-#else
-  unsigned int video_pres_mode_change         : 1; // 24
-  unsigned int zero                           : 7; // 25-31
-  
-  unsigned int resume                         : 1; // 16
-  unsigned int button_select_or_activate      : 1; // 17
-  unsigned int still_off                      : 1; // 18
-  unsigned int pause_on                       : 1; // 19
-  unsigned int audio_stream_change            : 1; // 20
-  unsigned int subpic_stream_change           : 1; // 21
-  unsigned int angle_change                   : 1; // 22
-  unsigned int karaoke_audio_pres_mode_change : 1; // 23
-  
-  unsigned int forward_scan                   : 1; // 8
-  unsigned int backward_scan                  : 1; // 9
-  unsigned int title_menu_call                : 1; // 10
-  unsigned int root_menu_call                 : 1; // 11
-  unsigned int subpic_menu_call               : 1; // 12
-  unsigned int audio_menu_call                : 1; // 13
-  unsigned int angle_menu_call                : 1; // 14
-  unsigned int chapter_menu_call              : 1; // 15
-  
-  unsigned int title_or_time_play             : 1; // 0
-  unsigned int chapter_search_or_play         : 1; // 1
-  unsigned int title_play                     : 1; // 2
-  unsigned int stop                           : 1; // 3
-  unsigned int go_up                          : 1; // 4
-  unsigned int time_or_chapter_search         : 1; // 5
-  unsigned int prev_or_top_pg_search          : 1; // 6
-  unsigned int next_pg_search                 : 1; // 7
-#endif
-} ATTRIBUTE_PACKED user_ops_t;
-
-/**
- * Program Chain Information.
- */
-typedef struct {
-  uint16_t zero_1;
-  uint8_t  nr_of_programs;
-  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 next_pgc_nr;
-  uint16_t prev_pgc_nr;
-  uint16_t goup_pgc_nr;
-  uint8_t  still_time;
-  uint8_t  pg_playback_mode;
-  uint32_t palette[16]; /* New type struct {zero_1, Y, Cr, Cb} ? */
-  uint16_t command_tbl_offset;
-  uint16_t program_map_offset;
-  uint16_t cell_playback_offset;
-  uint16_t cell_position_offset;
-  pgc_command_tbl_t *command_tbl;
-  pgc_program_map_t  *program_map;
-  cell_playback_t *cell_playback;
-  cell_position_t *cell_position;
-} ATTRIBUTE_PACKED pgc_t;
-#define PGC_SIZE 236
-
-/**
- * Program Chain Information Search Pointer.
- */
-typedef struct {
-  uint8_t  entry_id;
-#ifdef WORDS_BIGENDIAN
-  unsigned int block_mode : 2;
-  unsigned int block_type : 2;
-  unsigned int unknown1   : 4;
-#else
-  unsigned int unknown1   : 4;
-  unsigned int block_type : 2;
-  unsigned int block_mode : 2;
-#endif  
-  uint16_t ptl_id_mask;
-  uint32_t pgc_start_byte;
-  pgc_t *pgc;
-} ATTRIBUTE_PACKED pgci_srp_t;
-#define PGCI_SRP_SIZE 8
-
-/**
- * Program Chain Information Table.
- */
-typedef struct {
-  uint16_t nr_of_pgci_srp;
-  uint16_t zero_1;
-  uint32_t last_byte;
-  pgci_srp_t *pgci_srp;
-} ATTRIBUTE_PACKED pgcit_t;
-#define PGCIT_SIZE 8
-
-/**
- * Menu PGCI Language Unit.
- */
-typedef struct {
-  uint16_t lang_code;
-  uint8_t  zero_1;
-  uint8_t  exists;
-  uint32_t lang_start_byte;
-  pgcit_t *pgcit;
-} ATTRIBUTE_PACKED pgci_lu_t;
-#define PGCI_LU_SIZE 8
-
-/**
- * Menu PGCI Unit Table.
- */
-typedef struct {
-  uint16_t nr_of_lus;
-  uint16_t zero_1;
-  uint32_t last_byte;
-  pgci_lu_t *lu;
-} ATTRIBUTE_PACKED pgci_ut_t;
-#define PGCI_UT_SIZE 8
-
-/**
- * Cell Address Information.
- */
-typedef struct {
-  uint16_t vob_id;
-  uint8_t  cell_id;
-  uint8_t  zero_1;
-  uint32_t start_sector;
-  uint32_t last_sector;
-} ATTRIBUTE_PACKED cell_adr_t;
-
-/**
- * Cell Address Table.
- */
-typedef struct {
-  uint16_t nr_of_vobs; /* VOBs */
-  uint16_t zero_1;
-  uint32_t last_byte;
-  cell_adr_t *cell_adr_table;
-} ATTRIBUTE_PACKED c_adt_t;
-#define C_ADT_SIZE 8
-
-/**
- * VOBU Address Map.
- */
-typedef struct {
-  uint32_t last_byte;
-  uint32_t *vobu_start_sectors;
-} ATTRIBUTE_PACKED vobu_admap_t;
-#define VOBU_ADMAP_SIZE 4
-
-
-
-
-/**
- * VMGI
- *
- * The following structures relate to the Video Manager.
- */
-
-/**
- * Video Manager Information Management Table.
- */
-typedef struct {
-  char     vmg_identifier[12];
-  uint32_t vmg_last_sector;
-  uint8_t  zero_1[12];
-  uint32_t vmgi_last_sector;
-  uint8_t  zero_2;
-  uint8_t  specification_version;
-  uint32_t vmg_category;
-  uint16_t vmg_nr_of_volumes;
-  uint16_t vmg_this_volume_nr;
-  uint8_t  disc_side;
-  uint8_t  zero_3[19];
-  uint16_t vmg_nr_of_title_sets;  /* Number of VTSs. */
-  char     provider_identifier[32];
-  uint64_t vmg_pos_code;
-  uint8_t  zero_4[24];
-  uint32_t vmgi_last_byte;
-  uint32_t first_play_pgc;
-  uint8_t  zero_5[56];
-  uint32_t vmgm_vobs;             /* sector */
-  uint32_t tt_srpt;               /* sector */
-  uint32_t vmgm_pgci_ut;          /* sector */
-  uint32_t ptl_mait;              /* sector */
-  uint32_t vts_atrt;              /* sector */
-  uint32_t txtdt_mgi;             /* sector */
-  uint32_t vmgm_c_adt;            /* sector */
-  uint32_t vmgm_vobu_admap;       /* sector */
-  uint8_t  zero_6[32];
-  
-  video_attr_t vmgm_video_attr;
-  uint8_t  zero_7;
-  uint8_t  nr_of_vmgm_audio_streams; // should be 0 or 1
-  audio_attr_t vmgm_audio_attr;
-  audio_attr_t zero_8[7];
-  uint8_t  zero_9[17];
-  uint8_t  nr_of_vmgm_subp_streams; // should be 0 or 1
-  subp_attr_t  vmgm_subp_attr;
-  subp_attr_t  zero_10[27];  /* XXX: how much 'padding' here? */
-} 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;
-  unsigned int jlc_exists_in_prepost_cmd : 1;
-  unsigned int jlc_exists_in_button_cmd  : 1;
-  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 int title_or_time_play        : 1; // UOP 0
-  unsigned int chapter_search_or_play    : 1; // UOP 1
-  unsigned int jlc_exists_in_tt_dom      : 1;
-  unsigned int jlc_exists_in_button_cmd  : 1;
-  unsigned int jlc_exists_in_prepost_cmd : 1;
-  unsigned int jlc_exists_in_cell_cmd    : 1;
-  unsigned int multi_or_random_pgc_title : 1; // 0 == one sequential pgc title
-  unsigned int zero_1                    : 1;
-#endif
-} ATTRIBUTE_PACKED playback_type_t;
-
-/**
- * Title Information.
- */
-typedef struct {
-  playback_type_t pb_ty;
-  uint8_t  nr_of_angles;
-  uint16_t nr_of_ptts;
-  uint16_t parental_id;
-  uint8_t  title_set_nr;
-  uint8_t  vts_ttn;
-  uint32_t title_set_sector;
-} ATTRIBUTE_PACKED title_info_t;
-
-/**
- * PartOfTitle Search Pointer Table.
- */
-typedef struct {
-  uint16_t nr_of_srpts;
-  uint16_t zero_1;
-  uint32_t last_byte;
-  title_info_t *title;
-} ATTRIBUTE_PACKED tt_srpt_t;
-#define TT_SRPT_SIZE 8
-
-/**
- * Parental Management Information Unit Table.
- */
-typedef struct {
-  uint16_t country_code;
-  uint16_t zero_1;
-  uint16_t pf_ptl_mai_start_byte;
-  uint16_t zero_2;
-  /* uint16_t *pf_ptl_mai // table of nr_of_vtss+1 x 8 */
-} ATTRIBUTE_PACKED ptl_mait_country_t;
-#define PTL_MAIT_COUNTRY_SIZE 8
-
-/**
- * Parental Management Information Table.
- */
-typedef struct {
-  uint16_t nr_of_countries;
-  uint16_t nr_of_vtss;
-  uint32_t last_byte;
-  ptl_mait_country_t *countries;
-} ATTRIBUTE_PACKED ptl_mait_t;
-#define PTL_MAIT_SIZE 8
-
-/**
- * Video Title Set Attributes.
- */
-typedef struct {
-  uint32_t last_byte;
-  uint32_t vts_cat;
-  
-  video_attr_t vtsm_vobs_attr;
-  uint8_t  zero_1;
-  uint8_t  nr_of_vtsm_audio_streams; // should be 0 or 1
-  audio_attr_t vtsm_audio_attr;
-  audio_attr_t zero_2[7];  
-  uint8_t  zero_3[16];
-  uint8_t  zero_4;
-  uint8_t  nr_of_vtsm_subp_streams; // should be 0 or 1
-  subp_attr_t vtsm_subp_attr;
-  subp_attr_t zero_5[27];
-  
-  uint8_t  zero_6[2];
-  
-  video_attr_t vtstt_vobs_video_attr;
-  uint8_t  zero_7;
-  uint8_t  nr_of_vtstt_audio_streams;
-  audio_attr_t vtstt_audio_attr[8];
-  uint8_t  zero_8[16];
-  uint8_t  zero_9;
-  uint8_t  nr_of_vtstt_subp_streams;
-  subp_attr_t vtstt_subp_attr[32];
-} ATTRIBUTE_PACKED vts_attributes_t;
-#define VTS_ATTRIBUTES_SIZE 542
-#define VTS_ATTRIBUTES_MIN_SIZE 356
-
-/**
- * Video Title Set Attribute Table.
- */
-typedef struct {
-  uint16_t nr_of_vtss;
-  uint16_t zero_1;
-  uint32_t last_byte;
-  vts_attributes_t *vts;
-} ATTRIBUTE_PACKED vts_atrt_t;
-#define VTS_ATRT_SIZE 8
-
-/**
- * Text Data. (Incomplete)
- */
-typedef struct {
-  uint32_t last_byte;    /* offsets are relative here */
-  uint16_t offsets[100]; /* == nr_of_srpts + 1 (first is disc title) */
-#if 0  
-  uint16_t unknown; // 0x48 ?? 0x48 words (16bit) info following
-  uint16_t zero_1;
-  
-  uint8_t type_of_info;//?? 01 == disc, 02 == Title, 04 == Title part 
-  uint8_t unknown1;
-  uint8_t unknown2;
-  uint8_t unknown3;
-  uint8_t unknown4;//?? allways 0x30 language?, text format?
-  uint8_t unknown5;
-  uint16_t offset; // from first 
-  
-  char text[12]; // ended by 0x09
-#endif
-} ATTRIBUTE_PACKED txtdt_t;
-
-/**
- * Text Data Language Unit. (Incomplete)
- */ 
-typedef struct {
-  uint16_t lang_code;
-  uint16_t unknown;      /* 0x0001, title 1? disc 1? side 1? */
-  uint32_t txtdt_start_byte;  /* prt, rel start of vmg_txtdt_mgi  */
-  txtdt_t  *txtdt;
-} ATTRIBUTE_PACKED txtdt_lu_t;
-#define TXTDT_LU_SIZE 8
-
-/**
- * Text Data Manager Information. (Incomplete)
- */
-typedef struct {
-  char disc_name[14];            /* how many bytes?? */
-  uint16_t nr_of_language_units; /* 32bit??          */
-  uint32_t last_byte;
-  txtdt_lu_t *lu;
-} ATTRIBUTE_PACKED txtdt_mgi_t;
-#define TXTDT_MGI_SIZE 20
-
-
-/**
- * VTS
- *
- * Structures relating to the Video Title Set (VTS).
- */
-
-/**
- * Video Title Set Information Management Table.
- */
-typedef struct {
-  char vts_identifier[12];
-  uint32_t vts_last_sector;
-  uint8_t  zero_1[12];
-  uint32_t vtsi_last_sector;
-  uint8_t  zero_2;
-  uint8_t  specification_version;
-  uint32_t vts_category;
-  uint16_t zero_3;
-  uint16_t zero_4;
-  uint8_t  zero_5;
-  uint8_t  zero_6[19];
-  uint16_t zero_7;
-  uint8_t  zero_8[32];
-  uint64_t zero_9;
-  uint8_t  zero_10[24];
-  uint32_t vtsi_last_byte;
-  uint32_t zero_11;
-  uint8_t  zero_12[56];
-  uint32_t vtsm_vobs;       /* sector */
-  uint32_t vtstt_vobs;      /* sector */
-  uint32_t vts_ptt_srpt;    /* sector */
-  uint32_t vts_pgcit;       /* sector */
-  uint32_t vtsm_pgci_ut;    /* sector */
-  uint32_t vts_tmapt;       /* sector */  // XXX: FIXME TODO Implement
-  uint32_t vtsm_c_adt;      /* sector */
-  uint32_t vtsm_vobu_admap; /* sector */
-  uint32_t vts_c_adt;       /* sector */
-  uint32_t vts_vobu_admap;  /* sector */
-  uint8_t  zero_13[24];
-  
-  video_attr_t vtsm_video_attr;
-  uint8_t  zero_14;
-  uint8_t  nr_of_vtsm_audio_streams; // should be 0 or 1
-  audio_attr_t vtsm_audio_attr;
-  audio_attr_t zero_15[7];
-  uint8_t  zero_16[17];
-  uint8_t  nr_of_vtsm_subp_streams; // should be 0 or 1
-  subp_attr_t vtsm_subp_attr;
-  subp_attr_t zero_17[27];
-  uint8_t  zero_18[2];
-  
-  video_attr_t vts_video_attr;
-  uint8_t  zero_19;
-  uint8_t  nr_of_vts_audio_streams;
-  audio_attr_t vts_audio_attr[8];
-  uint8_t  zero_20[17];
-  uint8_t  nr_of_vts_subp_streams;
-  subp_attr_t vts_subp_attr[32];
-  /* XXX: how much 'padding' here, if any? */
-} ATTRIBUTE_PACKED vtsi_mat_t;
-
-/**
- * PartOfTitle Unit Information.
- */
-typedef struct {
-  uint16_t pgcn;
-  uint16_t pgn;
-} ATTRIBUTE_PACKED ptt_info_t;
-
-/**
- * PartOfTitle Information.
- */
-typedef struct {
-  uint16_t nr_of_ptts;
-  ptt_info_t *ptt;
-} ATTRIBUTE_PACKED ttu_t;
-
-/**
- * PartOfTitle Search Pointer Table.
- */
-typedef struct {
-  uint16_t nr_of_srpts;
-  uint16_t zero_1;
-  uint32_t last_byte;
-  ttu_t  *title;
-} ATTRIBUTE_PACKED vts_ptt_srpt_t;
-#define VTS_PTT_SRPT_SIZE 8
-
-
-#if PRAGMA_PACK
-#pragma pack()
-#endif
-
-
-/**
- * The following structure defines an IFO file.  The structure is divided into
- * two parts, the VMGI, or Video Manager Information, which is read from the
- * VIDEO_TS.[IFO,BUP] file, and the VTSI, or Video Title Set Information, which
- * is read in from the VTS_XX_0.[IFO,BUP] files.
- */
-typedef struct {
-  dvd_file_t *file;
-  
-  /* VMGI */
-  vmgi_mat_t     *vmgi_mat;
-  tt_srpt_t      *tt_srpt;
-  pgc_t          *first_play_pgc;    
-  ptl_mait_t     *ptl_mait;
-  vts_atrt_t     *vts_atrt;
-  txtdt_mgi_t    *txtdt_mgi;
-  
-  /* Common */
-  pgci_ut_t      *pgci_ut;
-  c_adt_t        *menu_c_adt;
-  vobu_admap_t   *menu_vobu_admap;
-  
-  /* VTSI */
-  vtsi_mat_t     *vtsi_mat;
-  vts_ptt_srpt_t *vts_ptt_srpt;
-  pgcit_t        *vts_pgcit;
-  int            *vts_tmapt; // FIXME add/correct the type
-  c_adt_t        *vts_c_adt;
-  vobu_admap_t   *vts_vobu_admap;
-} ifo_handle_t;
-
-#endif /* IFO_TYPES_H_INCLUDED */
diff --git a/extras/libdvdread/nav_print.c b/extras/libdvdread/nav_print.c
deleted file mode 100644 (file)
index f40d42c..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2000 Håkan Hjort <d95hjort@dtek.chalmers.se>
- *
- * Much of the contents in this file is based on VOBDUMP.
- *
- * VOBDUMP: a program for examining DVD .VOB filse
- *
- * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com>
- *
- * VOBDUMP is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.  Note that I am not
- * granting permission to redistribute or modify VOBDUMP under the
- * terms of any later version of the General Public License.
- *
- * This program is distributed in the hope that it will be useful (or
- * at least amusing), 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
- */
-
-#include <stdio.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "config.h" // Needed for WORDS_BIGENDIAN
-#include "nav_types.h"
-#include "nav_print.h"
-
-
-static void print_time(dvd_time_t *dtime) {
-  const char *rate;
-  assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa);
-  assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
-  assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
-  assert((dtime->frame_u&0xf) < 0xa);
-  
-  printf("%02x:%02x:%02x.%02x", 
-        dtime->hour,
-        dtime->minute,
-        dtime->second,
-        dtime->frame_u & 0x3f);
-  switch((dtime->frame_u & 0xc0) >> 6) {
-  case 1:
-    rate = "25.00";
-    break;
-  case 3:
-    rate = "29.97";
-    break;
-  default:
-    rate = "(please send a bug report)";
-    break;
-  } 
-  printf(" @ %s fps", rate);
-}
-
-
-static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
-  int i;
-
-  printf("pci_gi:\n");
-  printf("nv_pck_lbn    0x%08x\n", pci_gi->nv_pck_lbn);
-  printf("vobu_cat      0x%04x\n", pci_gi->vobu_cat);
-  printf("vobu_uop_ctl  0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl);
-  printf("vobu_s_ptm    0x%08x\n", pci_gi->vobu_s_ptm);
-  printf("vobu_e_ptm    0x%08x\n", pci_gi->vobu_e_ptm);
-  printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm);
-  printf("e_eltm        ");
-  print_time(&pci_gi->e_eltm);
-  printf("\n");
-  
-  printf("vobu_isrc     \"");
-  for(i = 0; i < 32; i++) {
-    char c = pci_gi->vobu_isrc[i];
-    if((c >= ' ') && (c <= '~'))
-      printf("%c", c);
-    else
-      printf(".");
-  }
-  printf("\"\n");
-}
-
-static void navPrint_NSML_AGLI(nsml_agli_t *nsml_agli) {
-  int i, j = 0;
-  
-  for(i = 0; i < 9; i++)
-    j |= nsml_agli->nsml_agl_dsta[i];
-  if(j == 0)
-    return;
-  
-  printf("nsml_agli:\n");
-  for(i = 0; i < 9; i++)
-    if(nsml_agli->nsml_agl_dsta[i])
-      printf("nsml_agl_c%d_dsta  0x%08x\n", i + 1, 
-            nsml_agli->nsml_agl_dsta[i]);
-}
-
-static void navPrint_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) {
-  
-  if((hl_gi->hli_ss & 0x03) == 0)
-    return;
-  
-  printf("hl_gi:\n");
-  printf("hli_ss        0x%01x\n", hl_gi->hli_ss & 0x03);
-  printf("hli_s_ptm     0x%08x\n", hl_gi->hli_s_ptm);
-  printf("hli_e_ptm     0x%08x\n", hl_gi->hli_e_ptm);
-  printf("btn_se_e_ptm  0x%08x\n", hl_gi->btn_se_e_ptm);
-
-  *btngr_ns = hl_gi->btngr_ns;
-  printf("btngr_ns      %d\n",  hl_gi->btngr_ns);
-  printf("btngr%d_dsp_ty    0x%02x\n", 1, hl_gi->btngr1_dsp_ty);
-  printf("btngr%d_dsp_ty    0x%02x\n", 2, hl_gi->btngr2_dsp_ty);
-  printf("btngr%d_dsp_ty    0x%02x\n", 3, hl_gi->btngr3_dsp_ty);
-  
-  printf("btn_ofn       %d\n", hl_gi->btn_ofn);
-  *btn_ns = hl_gi->btn_ns;
-  printf("btn_ns        %d\n", hl_gi->btn_ns);
-  printf("nsl_btn_ns    %d\n", hl_gi->nsl_btn_ns);
-  printf("fosl_btnn     %d\n", hl_gi->fosl_btnn);
-  printf("foac_btnn     %d\n", hl_gi->foac_btnn);
-}
-
-static void navPrint_BTN_COLIT(btn_colit_t *btn_colit) {
-  int i, j;
-  
-  j = 0;
-  for(i = 0; i < 6; i++)
-    j |= btn_colit->btn_coli[i/2][i&1];
-  if(j == 0)
-    return;
-  
-  printf("btn_colit:\n");
-  for(i = 0; i < 3; i++)
-    for(j = 0; j < 2; j++)
-      printf("btn_cqoli %d  %s_coli:  %08x\n",
-            i, (j == 0) ? "sl" : "ac",
-            btn_colit->btn_coli[i][j]);
-}
-
-static void navPrint_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) {
-  int i, j;
-  
-  printf("btnit:\n");
-  printf("btngr_ns: %i\n", btngr_ns);
-  printf("btn_ns: %i\n", btn_ns);
-  
-  if(btngr_ns == 0)
-    return;
-  
-  for(i = 0; i < btngr_ns; i++) {
-    for(j = 0; j < (36 / btngr_ns); j++) {
-      if(j < btn_ns) {
-       btni_t *btni = &btni_table[(36 / btngr_ns) * i + j];
-       
-       printf("group %d btni %d:  ", i+1, j+1);
-       printf("btn_coln %d, auto_action_mode %d\n",
-              btni->btn_coln, btni->auto_action_mode);
-       printf("coords   (%d, %d) .. (%d, %d)\n",
-              btni->x_start, btni->y_start, btni->x_end, btni->y_end);
-       
-       printf("up %d, ", btni->up);
-       printf("down %d, ", btni->down);
-       printf("left %d, ", btni->left);
-       printf("right %d\n", btni->right);
-       
-       // ifoPrint_COMMAND(&btni->cmd);
-       printf("\n");
-      }
-    }
-  }
-}
-
-static void navPrint_HLI(hli_t *hli) {
-  int btngr_ns = 0, btn_ns = 0;
-  
-  printf("hli:\n");
-  navPrint_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns);
-  navPrint_BTN_COLIT(&hli->btn_colit);
-  navPrint_BTNIT(hli->btnit, btngr_ns, btn_ns);
-}
-
-void navPrint_PCI(pci_t *pci) {
-  printf("pci packet:\n");
-  navPrint_PCI_GI(&pci->pci_gi);
-  navPrint_NSML_AGLI(&pci->nsml_agli);
-  navPrint_HLI(&pci->hli);
-}
-
-static void navPrint_DSI_GI(dsi_gi_t *dsi_gi) {
-  printf("dsi_gi:\n");
-  printf("nv_pck_scr     0x%08x\n", dsi_gi->nv_pck_scr);
-  printf("nv_pck_lbn     0x%08x\n", dsi_gi->nv_pck_lbn );
-  printf("vobu_ea        0x%08x\n", dsi_gi->vobu_ea);
-  printf("vobu_1stref_ea 0x%08x\n", dsi_gi->vobu_1stref_ea);
-  printf("vobu_2ndref_ea 0x%08x\n", dsi_gi->vobu_2ndref_ea);
-  printf("vobu_3rdref_ea 0x%08x\n", dsi_gi->vobu_3rdref_ea);
-  printf("vobu_vob_idn   0x%04x\n", dsi_gi->vobu_vob_idn);
-  printf("vobu_c_idn     0x%02x\n", dsi_gi->vobu_c_idn);
-  printf("c_eltm         ");
-  print_time(&dsi_gi->c_eltm);
-  printf("\n");
-}
-
-static void navPrint_SML_PBI(sml_pbi_t *sml_pbi) {
-  printf("sml_pbi:\n");
-  printf("category 0x%04x\n", sml_pbi->category);
-  if(sml_pbi->category & 0x8000)
-    printf("VOBU is in preunit\n");
-  if(sml_pbi->category & 0x4000)
-    printf("VOBU is in ILVU\n");
-  if(sml_pbi->category & 0x2000)
-    printf("VOBU at the beginning of ILVU\n");
-  if(sml_pbi->category & 0x1000)
-    printf("VOBU at end of PREU of ILVU\n");
-  
-  printf("ilvu_ea       0x%08x\n", sml_pbi->ilvu_ea);
-  printf("nxt_ilvu_sa   0x%08x\n", sml_pbi->ilvu_sa);
-  printf("nxt_ilvu_size 0x%04x\n", sml_pbi->size);
-  
-  printf("vob_v_s_s_ptm 0x%08x\n", sml_pbi->vob_v_s_s_ptm);
-  printf("vob_v_e_e_ptm 0x%08x\n", sml_pbi->vob_v_e_e_ptm);
-  
-  /* $$$ more code needed here */
-}
-
-static void navPrint_SML_AGLI(sml_agli_t *sml_agli) {
-  int i;
-  printf("sml_agli:\n");
-  for(i = 0; i < 9; i++) {
-    printf("agl_c%d address: 0x%08x size 0x%04x\n", i,
-          sml_agli->data[i].address, sml_agli->data[i].size);
-  }
-}
-
-static void navPrint_VOBU_SRI(vobu_sri_t *vobu_sri) {
-  int i;
-  int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11, 
-                    10,   9,  8,  7,  6,  5,  4,  3,  2, 1};
-  printf("vobu_sri:\n");
-  printf("Next VOBU with Video %08x\n", vobu_sri->next_video);
-  for(i = 0; i < 19; i++) {
-    printf("%3.1f %08x ", stime[i]/2.0, vobu_sri->fwda[i]);
-  }
-  printf("\n");
-  printf("Next VOBU %08x\n", vobu_sri->next_vobu);
-  printf("--\n");
-  printf("Prev VOBU %08x\n", vobu_sri->prev_vobu);
-  for(i = 0; i < 19; i++) {
-    printf("%3.1f %08x ", stime[18 - i]/2.0, vobu_sri->bwda[i]);
-  }
-  printf("\n");
-  printf("Prev VOBU with Video %08x\n", vobu_sri->prev_video);
-}
-
-static void navPrint_SYNCI(synci_t *synci) {
-  int i;
-  
-  printf("synci:\n");
-  /* $$$ more code needed here */
-  for(i = 0; i < 8; i++)
-    printf("%04x ", synci->a_synca[i]);
-  for(i = 0; i < 32; i++)
-    printf("%08x ", synci->sp_synca[i]);
-}
-
-void navPrint_DSI(dsi_t *dsi) {
-  printf("dsi packet:\n");
-  navPrint_DSI_GI(&dsi->dsi_gi);
-  navPrint_SML_PBI(&dsi->sml_pbi);
-  navPrint_SML_AGLI(&dsi->sml_agli);
-  navPrint_VOBU_SRI(&dsi->vobu_sri);
-  navPrint_SYNCI(&dsi->synci);
-}
-
-
diff --git a/extras/libdvdread/nav_print.h b/extras/libdvdread/nav_print.h
deleted file mode 100644 (file)
index 99a2e25..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2001 Billy Biggs <vektor@dumbterm.net>,
- *                    Håkan Hjort <d95hjort@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., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef NAV_PRINT_H_INCLUDED
-#define NAV_PRINT_H_INCLUDED
-
-#include <stdio.h>
-#include <nav_types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * This file provides example functions for printing information about the NAV
- * packet to stdout.
- */
-
-void navPrint_PCI(pci_t *pci);
-void navPrint_DSI(dsi_t *dsi);
-
-#ifdef __cplusplus
-};
-#endif
-#endif /* NAV_PRINT_H_INCLUDED */
diff --git a/extras/libdvdread/nav_read.c b/extras/libdvdread/nav_read.c
deleted file mode 100644 (file)
index 293dafb..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/**
- * Copyright (C) 2000 Håkan Hjort <d95hjort@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
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "config.h" // Needed for WORDS_BIGENDIAN
-#include "bswap.h"
-#include "nav_types.h"
-#include "nav_read.h"
-
-void navRead_PCI(pci_t *pci, unsigned char *buffer) {
-  int i, j;
-
-  assert(sizeof(pci_t) == PCI_BYTES - 1); // -1 for substream id
-  
-  memcpy(pci, buffer, sizeof(pci_t));
-
-  /* Endian conversions  */
-
-  /* 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 nsml_agli */
-  for(i = 0; i < 9; i++)
-    B2N_32(pci->nsml_agli.nsml_agl_dsta[i]);
-
-  /* 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 btn_colit */
-  for(i = 0; i < 3; i++)
-    for(j = 0; j < 2; j++)
-      B2N_32(pci->hli.btn_colit.btn_coli[i][j]);
-
-
-  /* pci hli btni */
-  /* There are some issues with this bitfiled with some compilers 
-     because they stradle word boundaries. */
-  
-#if !defined(WORDS_BIGENDIAN)
-  for(i = 0; i < 36; i++) {
-#if 0 /* Wierd Sun CC code that does not work */
-    unsigned char m[6];
-    memcpy(m, &pci->hli.btnit[i], 6);
-    pci->hli.btnit[i].zero1   = (m[1] >> 2);
-    pci->hli.btnit[i].x_start = (m[0] << 4) | (m[1] >> 4);
-    pci->hli.btnit[i].x_end   = (m[1] << 8) | m[2];
-    pci->hli.btnit[i].y_start = (m[3] << 4) | (m[4] >> 4);
-    pci->hli.btnit[i].y_end   = (m[4] << 8) | m[5];
-    pci->hli.btnit[i].zero2   = (m[4] >> 2);
-    pci->hli.btnit[i].btn_coln = (m[0] >> 6);
-    pci->hli.btnit[i].auto_action_mode = (m[3] >> 6);
-#else
-    char tmp[6], swap;
-    memcpy(tmp, &(pci->hli.btnit[i]), 6);
-    /* This is a B2N_24() */
-    swap = tmp[0]; tmp[0] = tmp[2]; tmp[2] = swap;
-    /* This is a B2N_24() */
-    swap = tmp[3]; tmp[3] = tmp[5]; tmp[5] = swap;
-    memcpy(&(pci->hli.btnit[i]), tmp, 6);
-#endif
-  }
-#endif
-
-
-  /* Asserts */
-
-  /* pci pci gi */ 
-  assert(pci->pci_gi.zero1 == 0);
-
-  /* pci hli hli_gi */
-  assert(pci->hli.hl_gi.zero1 == 0);
-  assert(pci->hli.hl_gi.zero2 == 0);
-  assert(pci->hli.hl_gi.zero3 == 0);
-  assert(pci->hli.hl_gi.zero4 == 0);
-  assert(pci->hli.hl_gi.zero5 == 0);
-
-  /* Are there buttons defined here? */
-  if((pci->hli.hl_gi.hli_ss & 0x03) != 0) {
-    assert(pci->hli.hl_gi.btn_ns != 0); 
-    assert(pci->hli.hl_gi.btngr_ns != 0); 
-  } else {
-    assert((pci->hli.hl_gi.btn_ns != 0 && pci->hli.hl_gi.btngr_ns != 0) 
-          || (pci->hli.hl_gi.btn_ns == 0 && pci->hli.hl_gi.btngr_ns == 0));
-  }
-
-  /* pci hli btnit */
-  
-#if NDEBUG
-  for(i = 0; i < pci->hli.hl_gi.btngr_ns; i++) {
-    for(j = 0; j < (36 / pci->hli.hl_gi.btngr_ns); j++) {
-      int n = (36 / pci->hli.hl_gi.btngr_ns) * i + j;
-      assert(pci->hli.btnit[n].zero1 == 0);
-      assert(pci->hli.btnit[n].zero2 == 0);
-      assert(pci->hli.btnit[n].zero3 == 0);
-      assert(pci->hli.btnit[n].zero4 == 0);
-      assert(pci->hli.btnit[n].zero5 == 0);
-      assert(pci->hli.btnit[n].zero6 == 0);
-      
-      if (j < pci->hli.hl_gi.btn_ns) { 
-       assert(pci->hli.btnit[n].x_start <= pci->hli.btnit[n].x_end);
-       assert(pci->hli.btnit[n].y_start <= pci->hli.btnit[n].y_end);
-       assert(pci->hli.btnit[n].up <= pci->hli.hl_gi.btn_ns);
-       assert(pci->hli.btnit[n].down <= pci->hli.hl_gi.btn_ns);
-       assert(pci->hli.btnit[n].left <= pci->hli.hl_gi.btn_ns);
-       assert(pci->hli.btnit[n].right <= pci->hli.hl_gi.btn_ns);
-       //vmcmd_verify(pci->hli.btnit[n].cmd);
-      } else {
-       int k;
-       assert(pci->hli.btnit[n].btn_coln == 0);
-       assert(pci->hli.btnit[n].auto_action_mode == 0);
-       assert(pci->hli.btnit[n].x_start == 0);
-       assert(pci->hli.btnit[n].y_start == 0);
-       assert(pci->hli.btnit[n].x_end == 0);
-       assert(pci->hli.btnit[n].y_end == 0);
-       assert(pci->hli.btnit[n].up == 0);
-       assert(pci->hli.btnit[n].down == 0);
-       assert(pci->hli.btnit[n].left == 0);
-       assert(pci->hli.btnit[n].right == 0);
-       for (k = 0; k < 8; k++)
-         assert(pci->hli.btnit[n].cmd.bytes[k] == 0); //CHECK_ZERO?
-      }
-    }
-  }
-#endif
-}
-
-void navRead_DSI(dsi_t *dsi, unsigned char *buffer) {
-  int i;
-
-  assert(sizeof(dsi_t) == DSI_BYTES - 1); // -1 for substream id
-  
-  memcpy(dsi, buffer, sizeof(dsi_t));
-
-  /* Endian conversions */
-
-  /* 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 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 agli */
-  for(i = 0; i < 9; i++) {
-    B2N_32(dsi->sml_agli.data[ i ].address);
-    B2N_16(dsi->sml_agli.data[ i ].size);
-  }
-
-  /* dsi vobu sri */
-  B2N_32(dsi->vobu_sri.next_video);
-  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);
-  for(i = 0; i < 19; i++)
-    B2N_32(dsi->vobu_sri.bwda[i]);
-  B2N_32(dsi->vobu_sri.prev_video);
-
-  /* dsi synci */
-  for(i = 0; i < 8; i++)
-    B2N_16(dsi->synci.a_synca[i]);
-  for(i = 0; i < 32; i++)
-    B2N_32(dsi->synci.sp_synca[i]);
-
-  
-  /* Asserts */
-
-  /* dsi dsi gi */
-  assert(dsi->dsi_gi.zero1 == 0);
-}
-
diff --git a/extras/libdvdread/nav_read.h b/extras/libdvdread/nav_read.h
deleted file mode 100644 (file)
index f0b6595..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2000, 2001 Håkan Hjort <d95hjort@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
- */
-
-#ifndef NAV_READ_H_INCLUDED
-#define NAV_READ_H_INCLUDED
-
-#include "nav_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Reads the PCI packet which begins at buffer into pci.
- */
-void navRead_PCI(pci_t *pci, unsigned char *buffer);
-
-/**
- * Reads the DSI packet which begins at buffer into dsi.
- */
-void navRead_DSI(dsi_t *dsi, unsigned char *buffer);
-
-#ifdef __cplusplus
-};
-#endif
-#endif /* NAV_READ_H_INCLUDED */
diff --git a/extras/libdvdread/nav_types.h b/extras/libdvdread/nav_types.h
deleted file mode 100644 (file)
index 6655154..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/**
- * Copyright (C) 2000 Håkan Hjort <d95hjort@dtek.chalmers.se>
- *
- * The data structures in this file should represent the layout of the
- * pci and dsi packets as they are stored in the stream.  Information
- * found by reading the source to VOBDUMP is the base for the structure
- * and names of these data types.
- *
- * VOBDUMP: a program for examining DVD .VOB files.
- * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com>
- *
- * VOBDUMP is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.  Note that I am not
- * granting permission to redistribute or modify VOBDUMP under the terms
- * of any later version of the General Public License.
- *
- * This program is distributed in the hope that it will be useful (or at
- * least amusing), 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
- */
-
-#ifndef NAV_TYPES_H_INCLUDED
-#define NAV_TYPES_H_INCLUDED
-
-#include <inttypes.h>
-#include "ifo_types.h" // only dvd_time_t, vm_cmd_t and user_ops_t
-
-
-#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN 
-#undef PRAGMA_PACK_END
-
-#if defined(__GNUC__)
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#define PRAGMA_PACK 0
-#endif
-#endif
-
-#if !defined(ATTRIBUTE_PACKED)
-#define ATTRIBUTE_PACKED
-#define PRAGMA_PACK 1
-#endif
-
-
-/* The length including the substream id byte. */
-#define PCI_BYTES 0x3d4
-#define DSI_BYTES 0x3fa
-
-#define PS2_PCI_SUBSTREAM_ID 0x00
-#define PS2_DSI_SUBSTREAM_ID 0x01
-
-/* Remove this */
-#define DSI_START_BYTE 1031
-
-
-#if PRAGMA_PACK
-#pragma pack(1)
-#endif
-
-
-/**
- * PCI General Information 
- */
-typedef struct {
-  uint32_t nv_pck_lbn;
-  uint16_t vobu_cat;
-  uint16_t zero1;
-  user_ops_t vobu_uop_ctl;
-  uint32_t vobu_s_ptm;
-  uint32_t vobu_e_ptm;
-  uint32_t vobu_se_e_ptm;
-  dvd_time_t e_eltm;
-  char vobu_isrc[32];
-} ATTRIBUTE_PACKED pci_gi_t;
-
-/**
- * Non Seamless Angle Information
- */
-typedef struct {
-  uint32_t nsml_agl_dsta[9]; 
-} ATTRIBUTE_PACKED nsml_agli_t;
-
-/** 
- * Highlight General Information 
- */
-typedef struct {
-  uint16_t hli_ss; // only low 2 bits
-  uint32_t hli_s_ptm;
-  uint32_t hli_e_ptm;
-  uint32_t btn_se_e_ptm;
-#ifdef WORDS_BIGENDIAN
-  unsigned int zero1 : 2;
-  unsigned int btngr_ns : 2;
-  unsigned int zero2 : 1;
-  unsigned int btngr1_dsp_ty : 3;
-  unsigned int zero3 : 1;
-  unsigned int btngr2_dsp_ty : 3;
-  unsigned int zero4 : 1;
-  unsigned int btngr3_dsp_ty : 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;
-  uint8_t btn_ns;     // only low 6 bits
-  uint8_t nsl_btn_ns; // only low 6 bits
-  uint8_t zero5;
-  uint8_t fosl_btnn;  // only low 6 bits
-  uint8_t foac_btnn;  // only low 6 bits
-} ATTRIBUTE_PACKED hl_gi_t;
-
-
-/** 
- * Button Color Information Table 
- */
-typedef struct {
-  uint32_t btn_coli[3][2];
-} ATTRIBUTE_PACKED btn_colit_t;
-
-
-/*
-  btn_coln         11000000 00000000 00000000 00000000 00000000 00000000
-  x_start          00111111 11110000 00000000 00000000 00000000 00000000
-  zero1            00000000 00001100 00000000 00000000 00000000 00000000
-  x_end            00000000 00000011 11111111 00000000 00000000 00000000
-  auto_action_mode 00000000 00000000 00000000 11000000 00000000 00000000
-  y_start          00000000 00000000 00000000 00111111 11110000 00000000
-  zero2            00000000 00000000 00000000 00000000 00001100 00000000
-  y_end            00000000 00000000 00000000 00000000 00000011 11111111
-
-  unsigned int btn_coln         : 2;  //  0 - m[0]>>6
-  unsigned int x_start          : 10; //  2 - m[0]<<4 | m[1]>>4
-  unsigned int zero1            : 2;  // 12 - m[1]>>2
-  unsigned int x_end            : 10; // 14 - m[1]<<8 | m[2]
-  
-  unsigned int auto_action_mode : 2;  // 24 - m[3]>>6
-  unsigned int y_start          : 10; // 26 - m[3]<<4 | m[4]>>4
-  unsigned int zero2            : 2;  // 36 - m[4]>>2
-  unsigned int y_end            : 10; // 38 - m[4]<<8 | m[5]
- */
-
-/** 
- * Button Information
- */
-typedef struct {
-#if 0 /* Wierd Sun CC code that does not work */
-  unsigned int zero1            : 2;
-  unsigned int x_start          : 10;
-  unsigned int x_end            : 10;
-  unsigned int y_start          : 10;
-  
-  unsigned int zero2            : 2;  
-  unsigned int btn_coln         : 2;
-  unsigned int auto_action_mode : 2;
-  unsigned int y_end            : 10;
-#endif
-#ifdef WORDS_BIGENDIAN
-  unsigned int btn_coln         : 2;
-  unsigned int x_start          : 10;
-  unsigned int zero1            : 2;
-  unsigned int x_end            : 10;
-  unsigned int auto_action_mode : 2;
-  unsigned int y_start          : 10;
-  unsigned int zero2            : 2;
-  unsigned int y_end            : 10;
-
-  unsigned int zero3            : 2;
-  unsigned int up               : 6;
-  unsigned int zero4            : 2;
-  unsigned int down             : 6;
-  unsigned int zero5            : 2;
-  unsigned int left             : 6;
-  unsigned int zero6            : 2;
-  unsigned int right            : 6;
-#else
-  unsigned int x_end            : 10;
-  unsigned int zero1            : 2;
-  unsigned int x_start          : 10;
-  unsigned int btn_coln         : 2;
-  unsigned int y_end            : 10;
-  unsigned int zero2            : 2;
-  unsigned int y_start          : 10;
-  unsigned int auto_action_mode : 2;
-
-  unsigned int up               : 6;
-  unsigned int zero3            : 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;
-
-/**
- * Highlight Information 
- */
-typedef struct {
-  hl_gi_t     hl_gi;
-  btn_colit_t btn_colit;
-  btni_t      btnit[36];
-} ATTRIBUTE_PACKED hli_t;
-
-/**
- * PCI packet
- */
-typedef struct {
-  pci_gi_t    pci_gi;
-  nsml_agli_t nsml_agli;
-  hli_t       hli;
-  uint8_t     zero1[189];
-} ATTRIBUTE_PACKED pci_t;
-
-
-
-
-/**
- * DSI General Information 
- */
-typedef struct {
-  uint32_t nv_pck_scr;
-  uint32_t nv_pck_lbn;
-  uint32_t vobu_ea;
-  uint32_t vobu_1stref_ea;
-  uint32_t vobu_2ndref_ea;
-  uint32_t vobu_3rdref_ea;
-  uint16_t vobu_vob_idn;
-  uint8_t  zero1;
-  uint8_t  vobu_c_idn;
-  dvd_time_t c_eltm;
-} ATTRIBUTE_PACKED dsi_gi_t;
-
-/**
- * Seamless Playback Information
- */
-typedef struct {
-  uint16_t category; // category of seamless VOBU
-  uint32_t ilvu_ea;  // end address of interleaved Unit (sectors)
-  uint32_t ilvu_sa;  // start address of next interleaved unit (sectors)
-  uint16_t size;     // size of next interleaved unit (sectors)
-  uint32_t vob_v_s_s_ptm; /* video start ptm in vob */
-  uint32_t vob_v_e_e_ptm; /* video end ptm in vob */
-  struct {
-    uint32_t stp_ptm1;
-    uint32_t stp_ptm2;
-    uint32_t gap_len1;
-    uint32_t gap_len2;      
-  } vob_a[8];
-} ATTRIBUTE_PACKED sml_pbi_t;
-
-/**
- * Seamless Angle Infromation for one angle
- */
-typedef struct {
-    uint32_t address; // Sector offset to next ILVU, high bit is before/after
-    uint16_t size;    // Byte size of the ILVU poited to by address.
-} ATTRIBUTE_PACKED sml_agl_data_t;
-
-/**
- * Seamless Angle Infromation
- */
-typedef struct {
-  sml_agl_data_t data[9];
-} ATTRIBUTE_PACKED sml_agli_t;
-
-/**
- * VOBU Search Information 
- */
-typedef struct {
-  uint32_t next_video; // Next vobu that contains video
-  uint32_t fwda[19];   // Forwards, time
-  uint32_t next_vobu;
-  uint32_t prev_vobu;
-  uint32_t bwda[19];   // Backwards, time
-  uint32_t prev_video;
-} ATTRIBUTE_PACKED vobu_sri_t;
-
-#define SRI_END_OF_CELL 0x3fffffff
-
-/**
- * Synchronous Information
- */ 
-typedef struct {
-  uint16_t a_synca[8];   // Sector offset to first audio packet for this VOBU
-  uint32_t sp_synca[32]; // Sector offset to first subpicture packet
-} ATTRIBUTE_PACKED synci_t;
-
-/**
- * DSI packet
- */
-typedef struct {
-  dsi_gi_t   dsi_gi;
-  sml_pbi_t  sml_pbi;
-  sml_agli_t sml_agli;
-  vobu_sri_t vobu_sri;
-  synci_t    synci;
-  uint8_t    zero1[471];
-} ATTRIBUTE_PACKED dsi_t;
-
-
-#if PRAGMA_PACK
-#pragma pack()
-#endif
-
-#endif /* NAV_TYPES_H_INCLUDED */
index f9f060fc4223617921f728edc8c1921107128ab5..1cb6f09bc50fd97012da089e91b5b52b9b91fa9c 100644 (file)
 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
 #undef TIME_WITH_SYS_TIME
 
-#undef PACKAGE
-#undef VERSION
-#undef DVD_DEVICE
-#undef VCD_DEVICE
-#undef COPYRIGHT_MESSAGE
-#undef MODULE_SUFFIX
-#undef MODULE_SYMBOL
-#undef VERSION_MESSAGE
-
 /* Define if you have the __argz_count function.  */
 #undef HAVE___ARGZ_COUNT
 
 /* Define if you have the vasprintf function.  */
 #undef HAVE_VASPRINTF
 
-/* Define if you have the </sys/dev/scsi/scsi_ioctl.h> header file.  */
-#undef HAVE__SYS_DEV_SCSI_SCSI_IOCTL_H
-
 /* Define if you have the <Cocoa/Cocoa.h> header file.  */
 #undef HAVE_COCOA_COCOA_H
 
 /* Define if you have the <dlfcn.h> header file.  */
 #undef HAVE_DLFCN_H
 
-/* Define if you have the <dvd.h> header file.  */
-#undef HAVE_DVD_H
+/* Define if you have the <dvdcss/dvdcss.h> header file.  */
+#undef HAVE_DVDCSS_DVDCSS_H
+
+/* Define if you have the <dvdread/dvd_reader.h> header file.  */
+#undef HAVE_DVDREAD_DVD_READER_H
 
 /* Define if you have the <fcntl.h> header file.  */
 #undef HAVE_FCNTL_H
 /* Define if you have the <limits.h> header file.  */
 #undef HAVE_LIMITS_H
 
-/* Define if you have the <linux/cdrom.h> header file.  */
-#undef HAVE_LINUX_CDROM_H
-
 /* Define if you have the <linux/fb.h> header file.  */
 #undef HAVE_LINUX_FB_H
 
 /* Define if you have the <strings.h> header file.  */
 #undef HAVE_STRINGS_H
 
-/* Define if you have the <sys/cdio.h> header file.  */
-#undef HAVE_SYS_CDIO_H
-
-/* Define if you have the <sys/dvdio.h> header file.  */
-#undef HAVE_SYS_DVDIO_H
-
-/* Define if you have the <sys/ioctl.h> header file.  */
-#undef HAVE_SYS_IOCTL_H
-
 /* Define if you have the <sys/param.h> header file.  */
 #undef HAVE_SYS_PARAM_H
 
 /* Define if you have the <unistd.h> header file.  */
 #undef HAVE_UNISTD_H
 
-/* Define if you have the <winioctl.h> header file.  */
-#undef HAVE_WINIOCTL_H
-
 /* Define if you have the mad library (-lmad).  */
 #undef HAVE_LIBMAD
 
 /* Define if you have the st library (-lst).  */
 #undef HAVE_LIBST
 
-/* css decryption with player keys */
-#undef HAVE_CSSKEYS
+/* Package name */
+#undef PACKAGE
+
+/* Package version */
+#undef VERSION
 
 /* Define if you have the iconv() function. */
 #undef HAVE_ICONV
 /* Define if your compiler groks C altivec extensions. */
 #undef CAN_COMPILE_C_ALTIVEC
 
-/* Define if <sys/cdio.h> defines dvd_struct. */
-#undef DVD_STRUCT_IN_SYS_CDIO_H
-
-/* Define if <sys/dvdio.h> defines dvd_struct. */
-#undef DVD_STRUCT_IN_SYS_DVDIO_H
-
-/* Define if <linux/cdrom.h> defines DVD_STRUCT. */
-#undef DVD_STRUCT_IN_LINUX_CDROM_H
-
-/* Define if <dvd.h> defines DVD_STRUCT. */
-#undef DVD_STRUCT_IN_DVD_H
-
-/* Define if <extras/BSDI_dvdioctl/dvd.h> defines DVD_STRUCT. */
-#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H
-
-/* Have userspace SCSI headers. */
-#undef SOLARIS_USCSI
-
-/* Define if <sys/scsi.h> defines sctl_io. */
-#undef HPUX_SCTL_IO
-
-/* Define if Linux-like dvd_struct is defined. */
-#undef HAVE_LINUX_DVD_STRUCT
-
-/* Define if OpenBSD-like dvd_struct is defined. */
-#undef HAVE_OPENBSD_DVD_STRUCT
-
-/* Define if FreeBSD-like dvd_struct is defined. */
-#undef HAVE_BSD_DVD_STRUCT
-
 /* define if compiling with satellite card support */
 #undef HAVE_SATELLITE
 
 /* Define if <st.h> defines st_init */
 #undef ST_INIT_IN_ST_H
 
+/* Simple version string */
+#undef VERSION_MESSAGE
+
+/* Copyright string */
+#undef COPYRIGHT_MESSAGE
+
+/* String suffix for module functions */
+#undef MODULE_SUFFIX
+
+/* Symbol suffix for module functions */
+#undef MODULE_SYMBOL
+
index b693687a2d09e16529c8ac1a78b10d8dbdda05f1..9a9d543ea3776842f20ac9de50563a6474b929a2 100755 (executable)
@@ -8,7 +8,6 @@ export CC=arm-linux-gcc
 export LD=arm-linux-ld
 export STRIP=arm-linux-strip
 export CONFIG_FLAGS="--enable-release --prefix=/usr --disable-gtk --enable-fb --enable-sdl --disable-xvideo --disable-plugins --with-tuning=strongarm1100 --x-includes=/skiff/local/arm-linux/include --x-libraries=/skiff/local/arm-linux/lib/X11 --with-sdl-config-path=/skiff/local/bin --with-mad=/skiff/local/arm-linux"
-export LIBDVDCSS_FLAGS="--with-dvdcss=local-static"
 export VIDDIR="usr/share/videolan"
 export PIXDIR="usr/share/pixmaps"
 export DESTDIR=/tmp/vlc
@@ -17,7 +16,7 @@ build: build-stamp
 build-stamp:
        ./configure --mandir=$${prefix}/share/man \
                --infodir=$${prefix}/share/info \
-               $(shell echo $(CONFIG_FLAGS)) $(shell echo $(LIBDVDCSS_FLAGS))
+               $(shell echo $(CONFIG_FLAGS))
 
 # This is ugly -- I know
        patch -p 0 < ipkg/patch
index 92e8bcde721bebd04bf58b699836b5f006364b36..d2514d76906db165349847d1d43bf5ef514fafe0 100644 (file)
@@ -1,8 +1 @@
-dvd_SOURCES = dvd.c dvd_access.c dvd_demux.c dvd_seek.c dvd_es.c dvd_ifo.c dvd_udf.c dvd_summary.c $(SRC_DVD_EXTRA)
-
-EXTRA_DEP = ../../lib/libdvdcss.a ../../lib/libdvdcss.so
-
-$(EXTRA_DEP): libdvdcss
-
-libdvdcss:
-       @cd ../../ && $(MAKE) libdvdcss
+dvd_SOURCES = dvd.c dvd_access.c dvd_demux.c dvd_seek.c dvd_es.c dvd_ifo.c dvd_udf.c dvd_summary.c
diff --git a/plugins/dvd/dummy_dvdcss.c b/plugins/dvd/dummy_dvdcss.c
deleted file mode 100644 (file)
index 83adde0..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*****************************************************************************
- * dummy_dvdcss.c: Dummy libdvdcss with minimal DVD access.
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: dummy_dvdcss.c,v 1.5 2001/12/30 07:09:55 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * 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, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <videolan/vlc.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/uio.h>                                        /* struct iovec */
-#include <sys/ioctl.h>
-
-#ifdef DVD_STRUCT_IN_LINUX_CDROM_H
-#   include <netinet/in.h>
-#   include <linux/cdrom.h>
-#else
-#   error "building dummy libdvdcss on this system does not make sense !"
-#endif
-
-#include "dummy_dvdcss.h"
-
-/*****************************************************************************
- * Local structure
- *****************************************************************************/
-struct dvdcss_s
-{
-    /* File descriptor */
-    int i_fd;
-};
-
-/*****************************************************************************
- * dvdcss_open: initialize library, open a DVD device, crack CSS key
- *****************************************************************************/
-extern dvdcss_handle dummy_dvdcss_open ( char *psz_target )
-{
-    dvdcss_handle dvdcss;
-    dvd_struct    dvd;
-
-    /* Allocate the library structure */
-    dvdcss = malloc( sizeof( struct dvdcss_s ) );
-    if( dvdcss == NULL )
-    {
-        fprintf( stderr, "dvd error: "
-                         "dummy libdvdcss could not allocate memory\n" );
-        return NULL;
-    }
-
-    /* Open the device */
-    dvdcss->i_fd = open( psz_target, 0 );
-    if( dvdcss->i_fd < 0 )
-    {
-        fprintf( stderr, "dvd error: "
-                         "dummy libdvdcss could not open device\n" );
-        free( dvdcss );
-        return NULL;
-    }
-
-    /* Check for encryption or ioctl failure */
-    dvd.type = DVD_STRUCT_COPYRIGHT;
-    dvd.copyright.layer_num = 0;
-    if( ioctl( dvdcss->i_fd, DVD_READ_STRUCT, &dvd ) != 0
-         || dvd.copyright.cpst )
-    {
-        fprintf( stderr, "dvd error: "
-                         "dummy libdvdcss could not decrypt disc\n" );
-        close( dvdcss->i_fd );
-        free( dvdcss );
-        return NULL;
-    }
-
-    return dvdcss;
-}
-
-/*****************************************************************************
- * dvdcss_error: return the last libdvdcss error message
- *****************************************************************************/
-extern char * dummy_dvdcss_error ( dvdcss_handle dvdcss )
-{
-    return "unknown error";
-}
-
-/*****************************************************************************
- * dvdcss_seek: seek into the device
- *****************************************************************************/
-extern int dummy_dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks,
-                                                     int i_flags )
-{
-    off_t i_read;
-
-    i_read = lseek( dvdcss->i_fd,
-                    (off_t)i_blocks * (off_t)DVDCSS_BLOCK_SIZE, SEEK_SET );
-
-    return i_read / DVDCSS_BLOCK_SIZE;
-}
-
-/*****************************************************************************
- * dvdcss_title: crack the current title key if needed
- *****************************************************************************/
-extern int dummy_dvdcss_title ( dvdcss_handle dvdcss, int i_block )
-{
-    return 0;
-}
-
-/*****************************************************************************
- * dvdcss_read: read data from the device, decrypt if requested
- *****************************************************************************/
-extern int dummy_dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
-                                                     int i_blocks,
-                                                     int i_flags )
-{
-    int i_bytes;
-
-    i_bytes = read( dvdcss->i_fd, p_buffer,
-                    (size_t)i_blocks * DVDCSS_BLOCK_SIZE );
-
-    return i_bytes / DVDCSS_BLOCK_SIZE;
-}
-
-/*****************************************************************************
- * dvdcss_readv: read data to an iovec structure, decrypt if reaquested
- *****************************************************************************/
-extern int dummy_dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
-                                                      int i_blocks,
-                                                      int i_flags )
-{
-    int i_read;
-
-    i_read = readv( dvdcss->i_fd, (struct iovec*)p_iovec, i_blocks );
-
-    return i_read / DVDCSS_BLOCK_SIZE;
-}
-
-/*****************************************************************************
- * dvdcss_close: close the DVD device and clean up the library
- *****************************************************************************/
-extern int dummy_dvdcss_close ( dvdcss_handle dvdcss )
-{
-    int i_ret;
-
-    i_ret = close( dvdcss->i_fd );
-
-    if( i_ret < 0 )
-    {
-        return i_ret;
-    }
-
-    free( dvdcss );
-
-    return 0;
-}
-
index cc428cbd4d17f11337a0c4f76c5dd2b0b90d5666..f9eb2d3f4d7faf49181624c48777a6224ee5be28 100644 (file)
@@ -2,7 +2,7 @@
  * dvd.c : DVD input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: dvd.c,v 1.26 2002/03/06 16:39:36 stef Exp $
+ * $Id: dvd.c,v 1.27 2002/04/03 06:23:07 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
 #include <videolan/vlc.h>
 
 #ifdef GOD_DAMN_DMCA
+#   include <stdio.h>
+#   include <fcntl.h>
+#   include <unistd.h>
+#   include <sys/types.h>
+#   include <sys/stat.h>
+#   include <sys/uio.h>                                      /* struct iovec */
+#   include <sys/ioctl.h>
 #   include <dlfcn.h>
+#   include <netinet/in.h>
+#   include <linux/cdrom.h>
+
 #   include "dummy_dvdcss.h"
 #endif
 
@@ -177,5 +187,138 @@ static void UnprobeLibDVDCSS( void )
         p_libdvdcss = NULL;
     }
 }
+
+/* Dummy libdvdcss with minimal DVD access. */
+
+/*****************************************************************************
+ * Local structure
+ *****************************************************************************/
+struct dvdcss_s
+{
+    /* File descriptor */
+    int i_fd;
+};
+
+/*****************************************************************************
+ * dvdcss_open: initialize library, open a DVD device, crack CSS key
+ *****************************************************************************/
+extern dvdcss_handle dummy_dvdcss_open ( char *psz_target )
+{
+    dvdcss_handle dvdcss;
+    dvd_struct    dvd;
+
+    /* Allocate the library structure */
+    dvdcss = malloc( sizeof( struct dvdcss_s ) );
+    if( dvdcss == NULL )
+    {
+        fprintf( stderr, "dvd error: "
+                         "dummy libdvdcss could not allocate memory\n" );
+        return NULL;
+    }
+
+    /* Open the device */
+    dvdcss->i_fd = open( psz_target, 0 );
+    if( dvdcss->i_fd < 0 )
+    {
+        fprintf( stderr, "dvd error: "
+                         "dummy libdvdcss could not open device\n" );
+        free( dvdcss );
+        return NULL;
+    }
+
+    /* Check for encryption or ioctl failure */
+    dvd.type = DVD_STRUCT_COPYRIGHT;
+    dvd.copyright.layer_num = 0;
+    if( ioctl( dvdcss->i_fd, DVD_READ_STRUCT, &dvd ) != 0
+         || dvd.copyright.cpst )
+    {
+        fprintf( stderr, "dvd error: "
+                         "dummy libdvdcss could not decrypt disc\n" );
+        close( dvdcss->i_fd );
+        free( dvdcss );
+        return NULL;
+    }
+
+    return dvdcss;
+}
+
+/*****************************************************************************
+ * dvdcss_error: return the last libdvdcss error message
+ *****************************************************************************/
+extern char * dummy_dvdcss_error ( dvdcss_handle dvdcss )
+{
+    return "generic error";
+}
+
+/*****************************************************************************
+ * dvdcss_seek: seek into the device
+ *****************************************************************************/
+extern int dummy_dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks,
+                                                     int i_flags )
+{
+    off_t i_read;
+
+    i_read = lseek( dvdcss->i_fd,
+                    (off_t)i_blocks * (off_t)DVDCSS_BLOCK_SIZE, SEEK_SET );
+
+    return i_read / DVDCSS_BLOCK_SIZE;
+}
+
+/*****************************************************************************
+ * dvdcss_title: crack the current title key if needed
+ *****************************************************************************/
+extern int dummy_dvdcss_title ( dvdcss_handle dvdcss, int i_block )
+{
+    return 0;
+}
+
+/*****************************************************************************
+ * dvdcss_read: read data from the device, decrypt if requested
+ *****************************************************************************/
+extern int dummy_dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
+                                                     int i_blocks,
+                                                     int i_flags )
+{
+    int i_bytes;
+
+    i_bytes = read( dvdcss->i_fd, p_buffer,
+                    (size_t)i_blocks * DVDCSS_BLOCK_SIZE );
+
+    return i_bytes / DVDCSS_BLOCK_SIZE;
+}
+
+/*****************************************************************************
+ * dvdcss_readv: read data to an iovec structure, decrypt if reaquested
+ *****************************************************************************/
+extern int dummy_dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
+                                                      int i_blocks,
+                                                      int i_flags )
+{
+    int i_read;
+
+    i_read = readv( dvdcss->i_fd, (struct iovec*)p_iovec, i_blocks );
+
+    return i_read / DVDCSS_BLOCK_SIZE;
+}
+
+/*****************************************************************************
+ * dvdcss_close: close the DVD device and clean up the library
+ *****************************************************************************/
+extern int dummy_dvdcss_close ( dvdcss_handle dvdcss )
+{
+    int i_ret;
+
+    i_ret = close( dvdcss->i_fd );
+
+    if( i_ret < 0 )
+    {
+        return i_ret;
+    }
+
+    free( dvdcss );
+
+    return 0;
+}
+
 #endif
 
index 13ed26c522a748796fbbf12bb459523ce06c9ce4..4159246847cc2bc091801353b79e4b5ec5fc1120 100644 (file)
@@ -8,7 +8,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_access.c,v 1.12 2002/04/02 10:17:08 sam Exp $
+ * $Id: dvd_access.c,v 1.13 2002/04/03 06:23:08 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -53,7 +53,7 @@
 #ifdef GOD_DAMN_DMCA
 #   include "dummy_dvdcss.h"
 #else
-#   include <videolan/dvdcss.h>
+#   include <dvdcss/dvdcss.h>
 #endif
 
 #include "stream_control.h"
index 13498ee3cd47139a9565fd93e065779e06626148..d6c0136846e8db5ac5e5cd1c60c600c19c23bb01 100644 (file)
@@ -1,7 +1,7 @@
 /* dvd_es.c: functions to find and select ES
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_es.c,v 1.5 2002/03/14 01:35:28 stef Exp $
+ * $Id: dvd_es.c,v 1.6 2002/04/03 06:23:08 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -46,7 +46,7 @@
 #ifdef GOD_DAMN_DMCA
 #   include "dummy_dvdcss.h"
 #else
-#   include <videolan/dvdcss.h>
+#   include <dvdcss/dvdcss.h>
 #endif
 
 #include "stream_control.h"
index e62c7093f825e4d2debba7f252ab10db9635d3f3..e77b342dae207ba602c22028e58ec56e92a7bd76 100644 (file)
@@ -2,7 +2,7 @@
  * dvd_ifo.c: Functions for ifo parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ifo.c,v 1.45 2002/03/08 22:58:12 stef Exp $
+ * $Id: dvd_ifo.c,v 1.46 2002/04/03 06:23:08 sam Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          German Tischler <tanis@gaspode.franken.de>
@@ -47,7 +47,7 @@
 #ifdef GOD_DAMN_DMCA
 #   include "dummy_dvdcss.h"
 #else
-#   include <videolan/dvdcss.h>
+#   include <dvdcss/dvdcss.h>
 #endif
 
 #include "dvd.h"
index a28b30096bd77dbd9082e4e4576499ad66d39216..bcb1550b710134ff41deb983c1d743f04b8e6130 100644 (file)
@@ -1,7 +1,7 @@
 /* dvd_seek.c: functions to navigate through DVD.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_seek.c,v 1.3 2002/03/09 16:48:33 stef Exp $
+ * $Id: dvd_seek.c,v 1.4 2002/04/03 06:23:08 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -46,7 +46,7 @@
 #ifdef GOD_DAMN_DMCA
 #   include "dummy_dvdcss.h"
 #else
-#   include <videolan/dvdcss.h>
+#   include <dvdcss/dvdcss.h>
 #endif
 
 #include "stream_control.h"
index d3289cad5985a4ef7bda4db3480fa96976433348..a538473f46db183b2a33647da5b1c9db815dce2f 100644 (file)
@@ -3,7 +3,7 @@
  * found in .ifo.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_summary.c,v 1.15 2002/03/08 22:58:12 stef Exp $
+ * $Id: dvd_summary.c,v 1.16 2002/04/03 06:23:08 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -50,7 +50,7 @@
 #ifdef GOD_DAMN_DMCA
 #   include "dummy_dvdcss.h"
 #else
-#   include <videolan/dvdcss.h>
+#   include <dvdcss/dvdcss.h>
 #endif
 
 #include "dvd.h"
index 4ee667e38578f86afbc438fa3d1fb120c8f8055d..85967de44050ee2dd8db520384d7322c32393336 100644 (file)
@@ -5,7 +5,7 @@
  * contains the basic udf handling functions
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_udf.c,v 1.19 2002/03/06 01:20:56 stef Exp $
+ * $Id: dvd_udf.c,v 1.20 2002/04/03 06:23:08 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -50,7 +50,7 @@
 #ifdef GOD_DAMN_DMCA
 #   include "dummy_dvdcss.h"
 #else
-#   include <videolan/dvdcss.h>
+#   include <dvdcss/dvdcss.h>
 #endif
 
 #include "dvd.h"
index 139d30e76051fdcd3a4694ed598bd7b60f7959ed..224e1a11d0989865673dd78fa1ae1fb37fa04cfb 100644 (file)
@@ -1,18 +1 @@
-dvdread_SOURCES = dvdread.c input_dvdread.c $(SRC_DVDREAD_EXTRA)
-
-ifeq (1,$(NEED_LIBDVDCSS))
-LIBDVDCSS_OBJ = ../../lib/libdvdcss.a ../../lib/libdvdcss.so
-endif
-LIBDVDREAD_OBJ = ../../lib/libdvdread.a
-
-EXTRA_DEP = $(LIBDVDCSS_OBJ) $(LIBDVDREAD_OBJ)
-
-$(LIBDVDCSS_OBJ): libdvdcss
-
-libdvdcss:
-       @cd ../../ && $(MAKE) libdvdcss
-
-$(LIBDVDREAD_OBJ): libdvdread
-
-libdvdread:
-       @cd ../../ && $(MAKE) libdvdread
+dvdread_SOURCES = dvdread.c input_dvdread.c
index 5ee5ac3cbdca08cd588ca0b32404aaf9d5d7e769..252c755f0fca11036fb84a6475036fd20a6e8300 100644 (file)
@@ -2,7 +2,7 @@
  * input_dvdread.h: thread structure of the DVD plugin
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dvdread.h,v 1.6 2002/03/04 01:53:56 stef Exp $
+ * $Id: input_dvdread.h,v 1.7 2002/04/03 06:23:08 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
  *****************************************************************************/
 
 /* dvdread includes */
-#include "dvd_reader.h"
-#include "ifo_types.h"
-#include "ifo_read.h"
-#include "dvd_udf.h"
-#include "nav_read.h"
-#include "nav_print.h"
+#include <dvdread/dvd_reader.h>
+#include <dvdread/ifo_types.h>
+#include <dvdread/ifo_read.h>
+#include <dvdread/dvd_udf.h>
+#include <dvdread/nav_read.h>
+#include <dvdread/nav_print.h>
 
 /* Logical block size for DVD-VIDEO */
 #define LB2OFF(x) ((off_t)(x) * (off_t)(DVD_VIDEO_LB_LEN))
index 5f7b6578e521f176e65dc7733f5bfeac60823717..78fcf372b4d2f34935351f1eeab3bc11ea49a661 100644 (file)
--- a/vlc.spec
+++ b/vlc.spec
@@ -1,22 +1,7 @@
-# The source tarball must be free of deCSS code..
-# ask me <yduret@mandrakesoft.com> before uploading
-
 %define name           vlc
 %define vlc_ver        0.2.92
 %define version                %vlc_ver
 
-%define css            0
-%if %{css}
-%define css_src                %nil
-%else
-%define css_src         -nocss
-%endif 
-%define css_name       libdvdcss
-%define css_version    1.0.0
-%define css_release    1mdk
-%define css_major      1
-%define css_lib_name   %{css_name}%{css_major}
-
 %define cvs            0
 %if %{cvs}
 %define cvsdate        20010619
@@ -37,7 +22,7 @@ Release:      %{release}
 %if %{cvs} 
 Source0:       http://www.videolan.org/pub/videolan/vlc/snapshots/%{cvs_name}.tar.bz2
 %else
-Source0:       http://www.videolan.org/packages/%{version}/%{name}-%{version}%{css_src}.tar.bz2
+Source0:       http://www.videolan.org/packages/%{version}/%{name}-%{version}.tar.bz2
 %endif
 License:       GPL
 Group:         Video
@@ -61,8 +46,8 @@ arbitrary, seeking in the stream, pause, fast forward and slow motion,
 hardware YUV acceleration and a few new interface features 
 including drag'n'drop.
 You may install vlc-gnome, vlc-gtk and vlc-qt vlc-gnome vlc-ncurses.
-This package contains no deCSS functionality.
-You need the decss library available from http://www.videolan.org
+This package contains no CSS unscrambling functionality.
+You need the libdvdcss library available from http://www.videolan.org/libdvdcss/
 
 %package gtk
 Summary: Gtk plug-in for VideoLAN, a DVD and MPEG2 player
@@ -138,43 +123,6 @@ Requires: %{name} = %{version}
 The vlc-alsa packages includes the Advanced Linux Sound Architecture plug-in for the VideoLAN client.
 If you are going to watch DVD with the ALSA plugin, you should install vlc-alsa
 
-%package -n %{css_lib_name}
-Summary:        A library for accessing a DVD like a block device using CSS decryption if needed.
-Version:       %{css_version}
-Release:       %{css_release}
-Group:          System/Libraries
-Provides:       %{css_name} = %{css_version}-%{css_release}
-
-%description -n %{css_lib_name}
-libdvdcss is a simple library designed for accessing a DVD like a block device
-without having to bother about the decryption. The important features are:
- * Portability. Currently supported platforms are GNU/Linux, FreeBSD, BeOS
-   and Windows. The MacOS X version is being worked on as well.
- * Simplicity. There are currently 7 functions in the API, and we intend to
-   keep this number low.
- * Freedom. libdvdcss is released under the General Public License, ensuring
-   it will stay free, and used only for free software products.
- * Just better. Unlike most similar projects, libdvdcss doesn't require the
-   region of your drive to be set.
-
-%package -n %{css_lib_name}-devel
-Summary:        Development tools for programs which will use the libdvdcss library.
-Version:        %{css_version}
-Release:        %{css_release}
-Group:          Development/C
-Requires:       %{css_lib_name} = %{css_version}
-Provides:       %{css_name}-devel = %{css_version}-%{css_release}
-
-%description -n %{css_lib_name}-devel
-The %{css_name}-devel package includes the header files and static libraries
-necessary for developing programs which will manipulate DVDs files using
-the %{css_name} library.
-
-If you are going to develop programs which will manipulate DVDs,
-you should install %{css_name}-devel.  You'll also need to have the %css_name
-package installed.
-
-
 %prep
 %if %{cvs}
 %setup -q -n %{cvs_name}
@@ -187,7 +135,6 @@ package installed.
 # Dadou - 0.1.99h-mdk - Don't use configure here. It breaks build at present
 #                       time.
 ./configure --enable-release \
-            --with-dvdcss=local-shared \
            --prefix=%_prefix \
            --enable-gnome --enable-x11 --enable-gtk --enable-qt \
            --enable-esd \
@@ -199,7 +146,6 @@ perl -pi -e "s|#CFLAGS \+= -mcpu=750|CFLAGS \+= -mcpu=750 -mtune=750|" Makefile
 %else
 #export CC="gcc-3.0.1" CXX="g++-3.0.1"
 %configure --enable-release \
-           --with-dvdcss=local-shared \
            --enable-gnome --enable-gtk \
           --enable-x11 --disable-qt --enable-ncurses \
           --enable-esd --enable-alsa \
@@ -351,22 +297,6 @@ rm -fr %buildroot
 %{_libdir}/videolan/vlc/alsa.so
 %endif
 
-%if %{css}
-%files -n %{css_lib_name}
-%defattr(-,root,root,-)
-%doc COPYING AUTHORS
-%{_libdir}/*.so.*
-%post   -n %{css_lib_name} -p /sbin/ldconfig
-%postun -n %{css_lib_name} -p /sbin/ldconfig
-
-%files -n %{css_lib_name}-devel
-%defattr(-,root,root)
-%doc COPYING
-%{_libdir}/*.a
-%{_libdir}/*.so
-%{_includedir}/*
-%endif
-
 %changelog
 * Thu Jan 17 2002 Yves Duret <yduret@mandrakesoft.com> 0.2.92-2mdk
 - readded libdvdcss rpm in specfile. use %%define css 1 with correct sources