1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-14 02:45:43 +00:00

rtc-device cmd option by James Noble

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12682 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2004-06-26 10:51:44 +00:00
parent 4bf094ac51
commit bca005762f
2 changed files with 5 additions and 2 deletions

View File

@ -412,6 +412,7 @@ m_option_t mplayer_opts[]={
{"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},

View File

@ -343,6 +343,7 @@ static char* menu_root = "main";
#ifdef HAVE_RTC
static int nortc;
static char* rtc_device;
#endif
#ifdef USE_EDL
@ -1093,8 +1094,9 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
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. */