changeset 3015:8bf21c807656

RTC is autodetected
author arpi
date Tue, 20 Nov 2001 07:53:20 +0000
parents 16576e05b93a
children ea414257856f
files configure mplayer.c
diffstat 2 files changed, 33 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Tue Nov 20 00:23:49 2001 +0000
+++ b/configure	Tue Nov 20 07:53:20 2001 +0000
@@ -119,6 +119,7 @@
   --disable-xanim        disable XAnim DLL support [autodetect]
   --enable-vorbis        build with OggVorbis support [autodetect]
   --disable-iconv        do not use iconv(3) function [autodetect]
+  --disable-rtc          disable RTC (/dev/rtc) on Linux [autodetect]
 
 Video:
   --enable-gl            build with OpenGL render support [autodetect]
@@ -147,6 +148,7 @@
   --disable-alsa         disable alsa sound support [autodetect]
   --disable-sunaudio     disable Sun sound support [autodetect]
   --disable-mad          disable mad audio support [autodetect]
+  --disable-select       disable using select() on OSS audio device [enable]
 
 Miscellaneous options:
   --cc=COMPILER          use this C compiler to build MPlayer [gcc]
@@ -155,8 +157,6 @@
                          options needed : --enable-static="-lslang -lncurses"
   --language=xx          select a language [en]
                          (Available: $LANGUAGES)
-  --disable-select       disable audio select() support (for example, required
-                         for ALSA or Vortex2 driver) [enable]
 
 Advanced options:
   --enable-mmx           build with mmx support [autodetect]
@@ -642,6 +642,7 @@
 _dvb=auto
 _dxr3=auto
 _iconv=auto
+_rtc=auto
 _ossaudio=auto
 _mad=auto
 _vorbis=auto
@@ -717,6 +718,8 @@
   --disable-dxr3)	_dxr3=no	;;
   --enable-iconv)	_iconv=yes	;;
   --disable-iconv)	_iconv=no	;;
+  --enable-rtc)	        _rtc=yes	;;
+  --disable-rtc)	_rtc=no	        ;;
   --enable-ossaudio)	_ossaudio=yes	;;
   --disable-ossaudio)	_ossaudio=no	;;
   --enable-mad)		_mad=yes	;;
@@ -1862,6 +1865,28 @@
 echores "$_zlib"
 
 
+echocheck "RTC"
+if linux ; then
+  if test "$_rtc" = auto ; then
+    cat > $TMPC << EOF
+#include <sys/ioctl.h>
+#include <linux/rtc.h>
+int main(void) { return RTC_IRQP_READ; }
+EOF
+    _rtc=no
+    cc_check && _rtc=yes
+  fi
+  echores "$_rtc"
+else
+  _rtc=no
+  echores "no (linux-specific)"
+fi
+if test "$_rtc" = yes ; then
+  _def_rtc='#define HAVE_RTC 1'
+else
+  _def_rtc='#undef HAVE_RTC'
+fi
+
 echocheck "mad support"
 if test "$_mad" = auto ; then
   _mad=no
@@ -2449,6 +2474,9 @@
 /* define this to use iconv(3) function to codepage conversions */
 $_def_iconv
 
+/* define this to use RTC (/dev/rtc) for video timers (LINUX only) */
+$_def_rtc
+
 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
 #define MAX_OUTBURST 65536
 
--- a/mplayer.c	Tue Nov 20 00:23:49 2001 +0000
+++ b/mplayer.c	Tue Nov 20 07:53:20 2001 +0000
@@ -75,7 +75,7 @@
 
 #define ABS(x) (((x)>=0)?(x):(-(x)))
 
-#ifdef TARGET_LINUX
+#ifdef HAVE_RTC
 #include <linux/rtc.h>
 #endif
 
@@ -601,7 +601,7 @@
   inited_flags|=INITED_LIRC;
 #endif
 
-#ifdef TARGET_LINUX
+#ifdef HAVE_RTC
     if ((rtc_fd = open("/dev/rtc", O_RDONLY)) < 0)
 	perror ("Linux RTC init: open");
     else {
@@ -1400,7 +1400,7 @@
 
 if(!(vo_flags&256)){ // flag 256 means: libvo driver does its timing (dvb card)
 
-#ifdef TARGET_LINUX
+#ifdef HAVE_RTC
     if(rtc_fd>=0){
 	// -------- RTC -----------
         while (time_frame > 0.000) {