fix compilation when dvdkit and dvdread are not available
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 14 Dec 2005 21:52:41 +0000 (21:52 +0000)
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 14 Dec 2005 21:52:41 +0000 (21:52 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@17192 b3059339-0415-0410-9bf9-f77b7e298cf2

configure
libmpdemux/Makefile
libmpdemux/open.c
libmpdemux/stream.c
libmpdemux/stream_dvd.c

index 2dce109..73269e8 100755 (executable)
--- a/configure
+++ b/configure
@@ -1493,6 +1493,7 @@ _faad_external=auto
 _faac=auto
 _ladspa=auto
 _xmms=no
+_have_dvd=no
 # dvdnav disabled, it does not work
 #_dvdnav=no
 _dvdread=auto
@@ -4948,6 +4949,7 @@ else
   _noinputmodules="mpdvdkit $_noinputmodules"
 fi
 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
+  _have_dvd=yes
   echores "yes"
 else
   echores "no"
@@ -4977,6 +4979,7 @@ case "$_dvdread" in
        _def_dvdread='#define USE_DVDREAD 1'
        _ld_dvdread='-ldvdread'
        _inputmodules="dvdread $_inputmodules"
+       _have_dvd=yes
        echores "yes"
        ;;
   no)
@@ -4990,6 +4993,7 @@ case "$_dvdread" in
        _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
        _noinputmodules="dvdread $_noinputmodules"
        _def_mpdvdkit="#define USE_MPDVDKIT 1"
+       _have_dvd=yes
        echores "disabled by libmpdvdkit"
        ;;
   libmpdvdkit2)
@@ -4998,10 +5002,17 @@ case "$_dvdread" in
        _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
        _noinputmodules="dvdread $_noinputmodules"
        _def_mpdvdkit="#define USE_MPDVDKIT 2"
+       _have_dvd=yes
        echores "disabled by libmpdvdkit2"
        ;;
 esac
 
+if test "$_have_dvd" = yes ; then
+  _def_have_dvd='#define HAVE_DVD 1'
+else
+  _def_have_dvd='#undef HAVE_DVD'
+fi
+
 # dvdnav disabled, it does not work
 # echocheck "DVD support (libdvdnav)"
 # if test "$_dvdnav" = yes ; then
@@ -7116,6 +7127,8 @@ SGIAUDIO_LIB = $_ld_sgiaudio
 TERMCAP_LIB = $_ld_termcap
 LIRC_LIB = $_ld_lirc
 LIRCC_LIB = $_ld_lircc
+HAVE_DVD = $_have_dvd
+DVDREAD = $_dvdread
 DVDREAD_LIB = $_ld_dvdread
 DVDKIT = $_dvdkit
 DVDKIT2 = $_dvdkit2
@@ -7290,6 +7303,7 @@ $_def_dvd_darwin
 $_def_sol_scsi_h
 $_def_hpux_scsi_h
 $_def_stddef
+$_def_have_dvd
 
 /* Common data directory (for fonts, etc) */
 #define MPLAYER_DATADIR "$_datadir"
index 01deaa3..62e65e6 100644 (file)
@@ -31,7 +31,6 @@ SRCS += cdda.c \
 
 # Stream readers/writers
 SRCS += stream.c \
-        stream_dvd.c \
         stream_file.c \
         stream_ftp.c \
         stream_livedotcom.c \
@@ -89,6 +88,9 @@ SRCS += demuxer.c \
         demux_vqf.c \
         demux_y4m.c \
 
+ifeq ($(HAVE_DVD),yes)
+SRCS += stream_dvd.c
+endif 
 ifeq ($(XMMS_PLUGINS),yes)
 SRCS += demux_xmms.c
 endif 
index 9d813d6..5fcfa5b 100644 (file)
 /// We keep these 2 for the gui atm, but they will be removed.
 int vcd_track=0;
 char* cdrom_device=NULL;
+int dvd_chapter=1;
+int dvd_last_chapter=0;
+char* dvd_device=NULL;
+int dvd_title=0;
 
 // Open a new stream  (stdin/file/vcd/url)
 
index 84babf0..4eebbbc 100644 (file)
@@ -75,7 +75,9 @@ extern stream_info_t stream_info_rtsp_sip;
 extern stream_info_t stream_info_cue;
 extern stream_info_t stream_info_null;
 extern stream_info_t stream_info_file;
+#ifdef HAVE_DVD
 extern stream_info_t stream_info_dvd;
+#endif
 
 stream_info_t* auto_open_streams[] = {
 #ifdef HAVE_VCD
@@ -110,7 +112,9 @@ stream_info_t* auto_open_streams[] = {
   &stream_info_smb,
 #endif
   &stream_info_cue,
+#ifdef HAVE_DVD
   &stream_info_dvd,
+#endif
 #ifdef USE_DVDNAV
   &stream_info_dvdnav;
 #endif
index eb0048b..c5793ff 100644 (file)
 #include "m_struct.h"
 
 /// We keep these 2 for the gui atm, but they will be removed.
-int dvd_title=0;
-int dvd_chapter=1;
-int dvd_last_chapter=0;
+extern int dvd_title;
+extern int dvd_chapter;
+extern int dvd_last_chapter;
+extern char* dvd_device;
 int dvd_angle=1;
-char* dvd_device=NULL;
 
+#ifdef HAVE_DVD
 #ifdef USE_DVDREAD
 #define        DVDREAD_VERSION(maj,min,micro)  ((maj)*10000 + (min)*100 + (micro))
 /*
@@ -792,3 +793,4 @@ stream_info_t stream_info_dvd = {
   &stream_opts,
   1 // Urls are an option string
 };
+#endif