[MPlayer-dev-eng] [PATCH] fixes linking with --enable-tv --disable-ossaudio

Chad Netzer cnetzer at sonic.net
Tue Oct 22 12:52:41 CEST 2002


The included patch fixes the following compilation/linking problems when
configure is called with "tv" enabled, and "ossaudio" disabled ("tv" is
automatically configured when your linux kernel supports the interface,
and I disable OSS because I prefer ALSA.)

The compilation/linking errors:


gcc -O4 -march=athlon-xp -mcpu=athlon-xp -pipe -ffast-math
-fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -Ilibmpdemux -Iloader -Ilibvo -I-I/usr/include
-I/usr/include/dvdnav    -I/usr/include/SDL -D_REENTRANT  -o mplayer
mplayer.o mp_msg.o cpudetect.o codec-cfg.o cfgparser.o my_profile.o
spudec.o playtree.o playtreeparser.o asxparser.o vobsub.o subreader.o
sub_cc.o find_sub.o unrarlib.o mixer.o mp-opt-reg.o libvo/libvo.a
libao2/libao2.a vidix/libvidix.a  libmpcodecs/libmpcodecs.a
mp3lib/libMP3.a liba52/liba52.a libmpeg2/libmpeg2.a loader/libloader.a
loader/dshow/libDS_Filter.a libaf/libaf.a libmpdemux/libmpdemux.a
input/libinput.a postproc/libpostproc.a linux/libosdep.a -Llibmpdvdkit2
-lmpdvdkit -L/usr/lib -ldvdnav -ldvdread -lpthread   -lmad -lvorbis
-logg    -ldivxdecore -ldv -lpng -lz -lz -ljpeg -lasound -ldl
-lpthread    -lcdda_interface -lcdda_paranoia -lnsl   -L/usr/lib
-Wl,-rpath,/usr/lib -lSDL -lpthread -lggi -laa -lGL -lXxf86dga -lXv
-lXxf86vm -lXinerama -L/usr/X11R6/lib -lXext -lX11 -lnsl -lmad -lnsl  
-lvgagl -lvga   -lgif -L/usr/X11R6/lib -lXext -lX11 -lnsl       
-lpthread -ldl   -lm 
libmpdemux/libmpdemux.a(audio_in.o): In function `audio_in_setup':
audio_in.o(.text+0x2ba): undefined reference to `ai_oss_init'
libmpdemux/libmpdemux.a(audio_in.o): In function
`audio_in_set_samplerate':
audio_in.o(.text+0x31c): undefined reference to `ai_oss_set_samplerate'
libmpdemux/libmpdemux.a(audio_in.o): In function
`audio_in_set_channels':
audio_in.o(.text+0x392): undefined reference to `ai_oss_set_channels'
collect2: ld returned 1 exit status

-------------- next part --------------
--- libmpdemux/audio_in.c.orig	2002-10-22 03:45:42.000000000 -0700
+++ libmpdemux/audio_in.c	2002-10-22 03:46:11.000000000 -0700
@@ -31,10 +31,12 @@
 	ai->alsa.device = strdup("default");
 	return 0;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ai->oss.audio_fd = -1;
 	ai->oss.device = strdup("/dev/dsp");
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -50,10 +52,12 @@
 	ai->setup = 1;
 	return 0;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	if (ai_oss_init(ai) < 0) return -1;
 	ai->setup = 1;
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -69,11 +73,13 @@
 	if (ai_alsa_setup(ai) < 0) return -1;
 	return ai->samplerate;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ai->req_samplerate = rate;
 	if (!ai->setup) return 0;
 	if (ai_oss_set_samplerate(ai) < 0) return -1;
 	return ai->samplerate;
+#endif
     default:
 	return -1;
     }
@@ -89,11 +95,13 @@
 	if (ai_alsa_setup(ai) < 0) return -1;
 	return ai->channels;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ai->req_channels = channels;
 	if (!ai->setup) return 0;
 	if (ai_oss_set_channels(ai) < 0) return -1;
 	return ai->channels;
+#endif
     default:
 	return -1;
     }
@@ -114,10 +122,12 @@
 	}
 	return 0;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	if (ai->oss.device) free(ai->oss.device);
 	ai->oss.device = strdup(device);
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -137,10 +147,12 @@
 	    ai->setup = 0;
 	    return 0;
 #endif
+#ifdef USE_OSS_AUDIO
 	case AUDIO_IN_OSS:
 	    close(ai->oss.audio_fd);
 	    ai->setup = 0;
 	    return 0;
+#endif
 	}
     }
     return -1;
@@ -153,8 +165,10 @@
     case AUDIO_IN_ALSA:
 	return snd_pcm_start(ai->alsa.handle);
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -185,6 +199,7 @@
 	}
 	return ret;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
 	if (ret != ai->blocksize) {
@@ -196,6 +211,7 @@
 	    return -1;
 	}
 	return ret;
+#endif
     default:
 	return -1;
     }


More information about the MPlayer-dev-eng mailing list