# HG changeset patch # User alex # Date 1088247104 0 # Node ID 6d815f12e3e56b360004412329f4b2b380663248 # Parent 331104f5743c313e9897ad540a1f035c6d5ec732 rtc-device cmd option by James Noble diff -r 331104f5743c -r 6d815f12e3e5 cfg-mplayer.h --- a/cfg-mplayer.h Sat Jun 26 10:40:23 2004 +0000 +++ b/cfg-mplayer.h Sat Jun 26 10:51:44 2004 +0000 @@ -412,6 +412,7 @@ {"softsleep", &softsleep, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #ifdef HAVE_RTC {"nortc", &nortc, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"rtc", &rtc_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif {"slave", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, diff -r 331104f5743c -r 6d815f12e3e5 mplayer.c --- a/mplayer.c Sat Jun 26 10:40:23 2004 +0000 +++ b/mplayer.c Sat Jun 26 10:51:44 2004 +0000 @@ -343,6 +343,7 @@ #ifdef HAVE_RTC static int nortc; +static char* rtc_device; #endif #ifdef USE_EDL @@ -1093,8 +1094,9 @@ 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 (/dev/rtc should be readable by the user.)\n", strerror(errno)); + if ((rtc_fd = open(rtc_device ? rtc_device : "/dev/rtc", O_RDONLY)) < 0) + mp_msg(MSGT_CPLAYER, MSGL_WARN, "Failed to open %s: %s (it should be readable by the user.)\n", + rtc_device ? rtc_device : "/dev/rtc", strerror(errno)); else { unsigned long irqp = 1024; /* 512 seemed OK. 128 is jerky. */