changeset 19763:b3855eac66ca

detect dvdnav before mpdvdkit and dvdread; if dvdnav is set mplayer will use the version of dvdread embedded in dvdnav
author nicodvb
date Sat, 09 Sep 2006 19:35:55 +0000
parents 59de9ee0ce47
children 499e5525d706
files configure stream/stream_dvd.h
diffstat 2 files changed, 43 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Sep 09 18:45:23 2006 +0000
+++ b/configure	Sat Sep 09 19:35:55 2006 +0000
@@ -5074,6 +5074,41 @@
 fi
 echores "$_vcd"
 
+echocheck "DVD support (libdvdnav)"
+if test "$_dvdnav" = auto ; then
+  $_dvdnavconfig --version >> $TMPLOG 2>&1 || _dvdnav=no
+fi
+if test "$_dvdnav" = auto ; then
+  cat > $TMPC <<EOF
+#include <dvdnav.h>
+int main(void) { dvdnav_t *dvd=0; return 0; }
+EOF
+  _dvdnav=no
+  _dvdnavdir=`$_dvdnavconfig --cflags`
+  _dvdnavlibs=`$_dvdnavconfig --libs`
+  _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
+  _used_css=
+  _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
+  test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
+       cc_check -I$_dvdnavdir $_dvdnavlibs $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
+fi
+if test "$_dvdnav" = yes ; then
+  _largefiles=yes
+  _def_dvdnav='#define USE_DVDNAV 1'
+  _ld_dvdnav=`$_dvdnavconfig --libs`
+  _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
+  _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
+  _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
+  _inputmodules="dvdnav $_inputmodules"
+  
+  #disable mpdvdkit and dvdread checks: dvdread will be enabled using dvdnav's version of dvdread
+  _mpdvdkit=no
+  _dvdread=yes
+else
+  _def_dvdnav='#undef USE_DVDNAV'
+  _noinputmodules="dvdnav $_noinputmodules"
+fi
+echores "$_dvdnav"
 
 echocheck "DVD support (libmpdvdkit2)"
 if test "$_mpdvdkit" = auto ; then
@@ -5134,7 +5169,9 @@
   yes)
 	_largefiles=yes
 	_def_dvdread='#define USE_DVDREAD 1'
-	_ld_dvdread='-ldvdread'
+        if test "$_dvdnav" != yes ; then
+          _ld_dvdread='-ldvdread'
+        fi
 	_inputmodules="dvdread $_inputmodules"
 	_have_dvd=yes
 	;;
@@ -5161,37 +5198,6 @@
   _def_have_dvd='#undef HAVE_DVD'
 fi
 
-echocheck "DVD support (libdvdnav)"
-if test "$_dvdnav" = auto ; then
-  $_dvdnavconfig --version >> $TMPLOG 2>&1 || _dvdnav=no
-fi
-if test "$_dvdnav" = auto ; then
-  cat > $TMPC <<EOF
-#include <dvdnav.h>
-int main(void) { dvdnav_t *dvd=0; return 0; }
-EOF
-  _dvdnav=no
-  _dvdnavdir=`$_dvdnavconfig --cflags`
-  _dvdnavlibs=`$_dvdnavconfig --libs`
-  _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
-  _used_css=
-  _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
-  test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
-       cc_check -I$_dvdnavdir $_dvdnavlibs $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
-fi
-if test "$_dvdnav" = yes ; then
-  _largefiles=yes
-  _def_dvdnav='#define USE_DVDNAV 1'
-  _ld_dvdnav=`$_dvdnavconfig --libs`
-  _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
-  _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
-  _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
-  _inputmodules="dvdnav $_inputmodules"
-else
-  _def_dvdnav='#undef USE_DVDNAV'
-  _noinputmodules="dvdnav $_noinputmodules"
-fi
-echores "$_dvdnav"
 
 echocheck "cdparanoia"
 if test "$_cdparanoia" = auto ; then
--- a/stream/stream_dvd.h	Sat Sep 09 18:45:23 2006 +0000
+++ b/stream/stream_dvd.h	Sat Sep 09 19:35:55 2006 +0000
@@ -6,6 +6,11 @@
 #include "libmpdvdkit2/ifo_types.h"
 #include "libmpdvdkit2/ifo_read.h"
 #include "libmpdvdkit2/nav_read.h"
+#elif defined(USE_DVDNAV)
+#include <dvd_reader.h>
+#include <ifo_types.h>
+#include <ifo_read.h>
+#include <nav_read.h>
 #else
 #include <dvdread/dvd_reader.h>
 #include <dvdread/ifo_types.h>