changeset 13579:fc357e2c7328

fixing --disable for mp3lib, liba52 and libmpeg2, patch by (basic (at) mozdev (dot) org), see also bug #102
author reimar
date Thu, 07 Oct 2004 09:31:16 +0000
parents b33ee5b68414
children 3588a4641781
files Makefile configure libmpdemux/demux_ts.c
diffstat 3 files changed, 34 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Oct 07 08:53:26 2004 +0000
+++ b/Makefile	Thu Oct 07 09:31:16 2004 +0000
@@ -33,7 +33,7 @@
 VO_LIBS = $(AA_LIB) $(X_LIB) $(SDL_LIB) $(GGI_LIB) $(MP1E_LIB) $(MLIB_LIB) $(SVGA_LIB) $(DIRECTFB_LIB) $(CACA_LIB)
 AO_LIBS = $(ARTS_LIB) $(ESD_LIB) $(JACK_LIB) $(NAS_LIB) $(SGIAUDIO_LIB)
 CODEC_LIBS = $(AV_LIB) $(FAME_LIB) $(MAD_LIB) $(VORBIS_LIB) $(THEORA_LIB) $(FAAD_LIB) $(LIBLZO_LIB) $(DECORE_LIB) $(XVID_LIB) $(DTS_LIB) $(PNG_LIB) $(Z_LIB) $(JPEG_LIB) $(ALSA_LIB) $(XMMS_LIB) $(X264_LIB)
-COMMON_LIBS = libmpcodecs/libmpcodecs.a mp3lib/libMP3.a liba52/liba52.a libmpeg2/libmpeg2.a $(W32_LIB) $(DS_LIB) libaf/libaf.a libmpdemux/libmpdemux.a input/libinput.a postproc/libswscale.a osdep/libosdep.a $(DVDREAD_LIB) $(CODEC_LIBS) $(FREETYPE_LIB) $(TERMCAP_LIB) $(CDPARANOIA_LIB) $(MPLAYER_NETWORK_LIB) $(WIN32_LIB) $(GIF_LIB) $(MACOSX_FRAMEWORKS) $(SMBSUPPORT_LIB) $(FRIBIDI_LIB) $(FONTCONFIG_LIB) $(ENCA_LIB)
+COMMON_LIBS = libmpcodecs/libmpcodecs.a $(W32_LIB) $(DS_LIB) libaf/libaf.a libmpdemux/libmpdemux.a input/libinput.a postproc/libswscale.a osdep/libosdep.a $(DVDREAD_LIB) $(CODEC_LIBS) $(FREETYPE_LIB) $(TERMCAP_LIB) $(CDPARANOIA_LIB) $(MPLAYER_NETWORK_LIB) $(WIN32_LIB) $(GIF_LIB) $(MACOSX_FRAMEWORKS) $(SMBSUPPORT_LIB) $(FRIBIDI_LIB) $(FONTCONFIG_LIB) $(ENCA_LIB)
 
 CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader -Ilibvo $(FREETYPE_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(SDL_INC) $(X11_INC) $(FRIBIDI_INC) $(DVB_INC) $(XVID_INC) $(FONTCONFIG_INC) $(CACA_INC) # -Wall
 ifeq ($(TOOLAME),yes)
@@ -41,7 +41,16 @@
 CODEC_LIBS += $(TOOLAME_LIB)
 endif
 
-PARTS = libmpdemux libmpcodecs mp3lib liba52 libmpeg2 libavcodec libavformat libao2 drivers osdep postproc input libvo libaf
+PARTS = libmpdemux libmpcodecs libavcodec libavformat libao2 drivers osdep postproc input libvo libaf
+ifeq ($(MP3LIB),yes)
+PARTS += mp3lib
+endif
+ifeq ($(LIBA52),yes)
+PARTS += liba52
+endif
+ifeq ($(LIBMPEG2),yes)
+PARTS += libmpeg2
+endif
 ifeq ($(INTERNAL_FAAD),yes)
 COMMON_LIBS += libfaad2/libfaad2.a 
 PARTS += libfaad2
@@ -74,8 +83,20 @@
 ALL_PRG += $(PRG_MENCODER)
 endif
 
-COMMON_DEPS = $(W32_DEP) $(DS_DEP) $(MP1E_DEP) $(AV_DEP) libmpdemux/libmpdemux.a libmpcodecs/libmpcodecs.a libao2/libao2.a liba52/liba52.a mp3lib/libMP3.a libmpeg2/libmpeg2.a osdep/libosdep.a postproc/libswscale.a input/libinput.a libvo/libvo.a libaf/libaf.a
+COMMON_DEPS = $(W32_DEP) $(DS_DEP) $(MP1E_DEP) $(AV_DEP) libmpdemux/libmpdemux.a libmpcodecs/libmpcodecs.a libao2/libao2.a osdep/libosdep.a postproc/libswscale.a input/libinput.a libvo/libvo.a libaf/libaf.a
 
+ifeq ($(MP3LIB),yes)
+COMMON_DEPS += mp3lib/libMP3.a
+COMMON_LIBS += mp3lib/libMP3.a
+endif
+ifeq ($(LIBA52),yes)
+COMMON_DEPS += liba52/liba52.a
+COMMON_LIBS += liba52/liba52.a
+endif
+ifeq ($(LIBMPEG2),yes)
+COMMON_DEPS += libmpeg2/libmpeg2.a
+COMMON_LIBS += libmpeg2/libmpeg2.a
+endif
 ifeq ($(INTERNAL_FAAD),yes)
 COMMON_DEPS += libfaad2/libfaad2.a
 endif
--- a/configure	Thu Oct 07 08:53:26 2004 +0000
+++ b/configure	Thu Oct 07 09:31:16 2004 +0000
@@ -4989,7 +4989,7 @@
   _def_liba52='#define USE_LIBA52 1'
   _codecmodules="liba52 $_codecmodules"
 else
-  _def_liba52'#undef USE_LIBA52'
+  _def_liba52='#undef USE_LIBA52'
   _nocodecmodules="liba52 $_nocodecmodules"
 fi
 echores "$_liba52"
@@ -5019,7 +5019,7 @@
   _def_libmpeg2='#define USE_LIBMPEG2 1'
   _codecmodules="libmpeg2 $_codecmodules"
 else
-  _def_libmpeg2'#undef USE_LIBMPEG2'
+  _def_libmpeg2='#undef USE_LIBMPEG2'
   _nocodecmodules="libmpeg2 $_nocodecmodules"
 fi
 echores "$_libmpeg2"
@@ -6294,6 +6294,10 @@
 
 OPENDIVX = $_opendivx
 
+MP3LIB = $_mp3lib
+LIBA52 = $_liba52
+LIBMPEG2 = $_libmpeg2
+
 UNRARLIB = $_unrarlib
 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
 PNG = $_mkf_png
--- a/libmpdemux/demux_ts.c	Thu Oct 07 08:53:26 2004 +0000
+++ b/libmpdemux/demux_ts.c	Thu Oct 07 09:31:16 2004 +0000
@@ -374,6 +374,7 @@
 } tsdemux_init_t;
 
 
+#ifdef USE_LIBA52
 //second stage: returns the count of A52 syncwords found
 static int a52_check(char *buf, int len)
 {
@@ -401,6 +402,7 @@
 	mp_msg(MSGT_DEMUXER, MSGL_V, "A52_CHECK(%d input bytes), found %d frame syncwords of %d bytes length\n", len, ok, frame_length);	
 	return ok;
 }
+#endif
 
 
 static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param)
@@ -432,6 +434,7 @@
 		pos = stream_tell(demuxer->stream);
 		if(ts_parse(demuxer, &es, tmp, 1))
 		{
+#ifdef USE_LIBA52
 			//Non PES-aligned A52 audio may escape detection if PMT is not present;
 			//in this case we try to find at least 3 A52 syncwords
 			if((es.type == PES_PRIVATE1) && (! audio_found))
@@ -449,6 +452,7 @@
 					}
 				}
 			}
+#endif
 			
 			is_audio = ((es.type == AUDIO_MP2) || (es.type == AUDIO_A52) || (es.type == AUDIO_LPCM_BE) || (es.type == AUDIO_AAC));
 			is_video = ((es.type == VIDEO_MPEG1) || (es.type == VIDEO_MPEG2) || (es.type == VIDEO_MPEG4));