[MPlayer-dev-eng] [PATCH] -- FreeBSD RTC Support
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Dec 25 16:38:37 CET 2004
Hi,
> Hi, This patch enables RTC support for FreeBSD.
> I've personally been using rtc with mplayer for almost a year and
> it works really well and this has been an option in FreeBSD ports for
> over 9 months now.
Here's the patch I wanted to suggest in my last mail...
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.946
diff -u -r1.946 configure
--- configure 23 Dec 2004 15:36:00 -0000 1.946
+++ configure 25 Dec 2004 15:32:33 -0000
@@ -167,6 +167,7 @@
--disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
--disable-edl disable EDL (edit decision list) support [enable]
--disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
+ --disable-bsdrtc disable BSD style RTC (/dev/rtc) [autodetect]
--disable-network disable network support (for: http/mms/rtp) [enable]
--enable-winsock2 enable winsock2 usage [autodetect]
--enable-smb enable Samba (SMB) input support [autodetect]
@@ -1300,6 +1302,7 @@
_iconv=auto
_langinfo=auto
_rtc=auto
+_bsdrtc=auto
_ossaudio=auto
_arts=auto
_esd=auto
@@ -1472,6 +1476,8 @@
--disable-langinfo) _langinfo=no ;;
--enable-rtc) _rtc=yes ;;
--disable-rtc) _rtc=no ;;
+ --enable-bsdrtc) _bsdrtc=yes ;;
+ --disable-bsdrtc) _bsdrtc=no ;;
--enable-mp1e) _mp1e=yes ;;
--disable-mp1e) _mp1e=no ;;
--enable-libdv) _libdv=yes ;;
@@ -5000,7 +5012,6 @@
echocheck "RTC"
-if linux ; then
if test "$_rtc" = auto ; then
cat > $TMPC << EOF
#include <sys/ioctl.h>
@@ -5010,17 +5021,30 @@
_rtc=no
cc_check && _rtc=yes
fi
- echores "$_rtc"
-else
- _rtc=no
- echores "no (Linux specific feature)"
-fi
if test "$_rtc" = yes ; then
_def_rtc='#define HAVE_RTC 1'
+ _bsdrtc=no
+ echores "yes"
else
_def_rtc='#undef HAVE_RTC'
fi
+if test "$_bsdrtc" = auto ; then
+ cat > $TMPC << EOF
+#include <sys/ioctl.h>
+#include <rtc.h>
+int main(void) { return RTCIO_IRQP_READ; }
+EOF
+ _bsdrtc=no
+ cc_check && _bsdrtc=yes
+fi
+if test "$_bsdrtc" = yes ; then
+ _def_bsdrtc='#define HAVE_BSDRTC 1'
+ echores "yes (BSD style)"
+else
+ _def_bsdrtc='#undef HAVE_BSDRTC'
+ echores "no"
+fi
echocheck "external liblzo support"
if test "$_liblzo" = auto ; then
@@ -6844,6 +6868,9 @@
/* define this to use RTC (/dev/rtc) for video timers (LINUX only) */
$_def_rtc
+/* as above but with BSD style RTC headers (RTCIO_*) */
+$_def_bsdrtc
+
/* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
#define MAX_OUTBURST 65536
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.821
diff -u -r1.821 mplayer.c
--- mplayer.c 21 Dec 2004 12:25:58 -0000 1.821
+++ mplayer.c 25 Dec 2004 15:32:44 -0000
@@ -94,6 +94,11 @@
#ifdef HAVE_RTC
#include <linux/rtc.h>
+#elif defined(HAVE_BSDRTC)
+#include <rtc.h>
+#define RTC_IRQP_SET RTCIO_IRQP_SET
+#define RTC_PIE_ON RTCIO_PIE_ON
+#define HAVE_RTC 1
#endif
#ifdef USE_TV
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.235
diff -u -r1.235 cfg-mplayer.h
--- cfg-mplayer.h 21 Dec 2004 20:33:50 -0000 1.235
+++ cfg-mplayer.h 25 Dec 2004 15:35:35 -0000
@@ -115,7 +115,7 @@
extern int xinerama_screen;
#endif
-#ifdef HAVE_RTC
+#if defined(HAVE_RTC) || defined(HAVE_BSDRTC)
extern int nortc;
#endif
More information about the MPlayer-dev-eng
mailing list