[MPlayer-dev-eng] [PATCH] Linux DevFS/RTC resubmission

Robert Cardell rbt at mtlb.co.uk
Fri Oct 25 22:51:16 CEST 2002


On Fri, Oct 25, 2002 at 05:06:17PM +0000, Sebastian Otaegui wrote:
> Hi, 
> 
> On Fri, 25 Oct 2002 20:39:16 +0100
> Robert Cardell <rbt at mtlb.co.uk> wrote:
> 
> >Tested and works
> > great for me. Patch is against -pre9.
> 
> 
> It is said that you should diff against CVS, _NOT_ other versions.
> 
Alrighty....

-------------- next part --------------
? mplayer.patch
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.587
diff -u -r1.587 configure
--- configure	25 Oct 2002 17:42:20 -0000	1.587
+++ configure	25 Oct 2002 21:17:40 -0000
@@ -3421,8 +3421,14 @@
 fi
 if test "$_rtc" = yes ; then
   _def_rtc='#define HAVE_RTC 1'
+  if test "$_linux_devfs" = yes; then
+    _def_rtc_dev='#define PATH_DEV_RTC "/dev/misc/rtc"'
+  else
+    _def_rtc_dev='#define PATH_DEV_RTC "/dev/rtc"'
+  fi
 else
   _def_rtc='#undef HAVE_RTC'
+  _def_rtc_dev='#define PATH_DEV_RTC ""'
 fi
 
 
@@ -4645,6 +4651,9 @@
 
 /* define this to use RTC (/dev/rtc) for video timers (LINUX only) */
 $_def_rtc
+
+/* define this to the RTC device node (normally /dev/rtc) */
+$_def_rtc_dev
 
 /* 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.603
diff -u -r1.603 mplayer.c
--- mplayer.c	25 Oct 2002 09:42:55 -0000	1.603
+++ mplayer.c	25 Oct 2002 21:17:44 -0000
@@ -711,9 +711,11 @@
   if(!nortc)
   {
     // seteuid(0); /* Can't hurt to try to get root here */
-    if ((rtc_fd = open("/dev/rtc", O_RDONLY)) < 0)
-	mp_msg(MSGT_CPLAYER, MSGL_WARN, "Failed to open /dev/rtc: %s (mplayer should be setuid root or /dev/rtc should be readable by the user.)\n", strerror(errno));
-     else {
+    if ((rtc_fd = open(PATH_DEV_RTC, O_RDONLY)) < 0)
+    {
+	mp_msg(MSGT_CPLAYER, MSGL_WARN, "Failed to open " PATH_DEV_RTC ": %s\n", strerror(errno));
+	mp_msg(MSGT_CPLAYER, MSGL_HINT, "See the RTC section of the documentation for help.\n");
+    } else {
 	unsigned long irqp = 1024; /* 512 seemed OK. 128 is jerky. */
 
 	if (ioctl(rtc_fd, RTC_IRQP_SET, irqp) < 0) {


More information about the MPlayer-dev-eng mailing list