changeset 17191:6ac0b5f0d1ed

fix compilation when dvdkit and dvdread are not available
author nicodvb
date Wed, 14 Dec 2005 21:52:41 +0000
parents d31af70c564e
children 3327440009c7
files configure libmpdemux/Makefile libmpdemux/open.c libmpdemux/stream.c libmpdemux/stream_dvd.c
diffstat 5 files changed, 31 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Wed Dec 14 19:35:25 2005 +0000
+++ b/configure	Wed Dec 14 21:52:41 2005 +0000
@@ -1493,6 +1493,7 @@
 _faac=auto
 _ladspa=auto
 _xmms=no
+_have_dvd=no
 # dvdnav disabled, it does not work
 #_dvdnav=no
 _dvdread=auto
@@ -4948,6 +4949,7 @@
   _noinputmodules="mpdvdkit $_noinputmodules"
 fi
 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
+  _have_dvd=yes
   echores "yes"
 else
   echores "no"
@@ -4977,6 +4979,7 @@
 	_def_dvdread='#define USE_DVDREAD 1'
 	_ld_dvdread='-ldvdread'
 	_inputmodules="dvdread $_inputmodules"
+	_have_dvd=yes
 	echores "yes"
 	;;
   no)
@@ -4990,6 +4993,7 @@
 	_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 @@
 	_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 @@
 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_sol_scsi_h
 $_def_hpux_scsi_h
 $_def_stddef
+$_def_have_dvd
 
 /* Common data directory (for fonts, etc) */
 #define MPLAYER_DATADIR "$_datadir"
--- a/libmpdemux/Makefile	Wed Dec 14 19:35:25 2005 +0000
+++ b/libmpdemux/Makefile	Wed Dec 14 21:52:41 2005 +0000
@@ -31,7 +31,6 @@
 
 # Stream readers/writers
 SRCS += stream.c \
-        stream_dvd.c \
         stream_file.c \
         stream_ftp.c \
         stream_livedotcom.c \
@@ -89,6 +88,9 @@
         demux_vqf.c \
         demux_y4m.c \
 
+ifeq ($(HAVE_DVD),yes)
+SRCS += stream_dvd.c
+endif 
 ifeq ($(XMMS_PLUGINS),yes)
 SRCS += demux_xmms.c
 endif 
--- a/libmpdemux/open.c	Wed Dec 14 19:35:25 2005 +0000
+++ b/libmpdemux/open.c	Wed Dec 14 21:52:41 2005 +0000
@@ -24,6 +24,10 @@
 /// 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)
 
--- a/libmpdemux/stream.c	Wed Dec 14 19:35:25 2005 +0000
+++ b/libmpdemux/stream.c	Wed Dec 14 21:52:41 2005 +0000
@@ -75,7 +75,9 @@
 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_smb,
 #endif
   &stream_info_cue,
+#ifdef HAVE_DVD
   &stream_info_dvd,
+#endif
 #ifdef USE_DVDNAV
   &stream_info_dvdnav;
 #endif
--- a/libmpdemux/stream_dvd.c	Wed Dec 14 19:35:25 2005 +0000
+++ b/libmpdemux/stream_dvd.c	Wed Dec 14 21:52:41 2005 +0000
@@ -26,12 +26,13 @@
 #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_opts,
   1 // Urls are an option string
 };
+#endif