[PATCH] Re: [MPlayer-dev-eng] Real Time Clock into timer-lx.c?

Arpi arpi at thot.banki.hu
Sun Sep 22 19:22:36 CEST 2002


Hi,

> > will break everything!
> 
> Understood.  New patch... but let me know if you want a patch that makes
> a separate timer-rtc.c, or a patch which fixes the problems but leaves
> it in main()?

i've checked this patch... hmm.
i'm not against moving the whole RTC code to timer-lx.c, but don't mix it
with other funcs like GetRelativeTime and usec_sleep.

> +      seteuid(0);

> -#ifdef HAVE_NEW_GUI
> -// breaks DGA and SVGAlib and VESA drivers:  --A'rpi
> -// and now ? -- Pontscho
> -    if(use_gui) setuid( getuid() ); // strongly test, please check this.
> -#endif
> -    if(rtc_fd<0)
> -#endif

ah and please left this setuid chanegs out, also for mplayer.c gui stuff!!!

> -
> -#ifdef HAVE_RTC
> -    if(rtc_fd>=0){
> -	// -------- RTC -----------
> -	current_module="sleep_rtc";
> -        while (time_frame > 0.000) {
> -	    unsigned long long rtc_ts;
> -	    if (read (rtc_fd, &rtc_ts, sizeof(rtc_ts)) <= 0)
> -		    mp_msg(MSGT_CPLAYER, MSGL_ERR, "Linux RTC read error: %s\n", strerror(errno));
> -    	    time_frame-=GetRelativeTime();
> -	}
> -    } else
> -#endif
> -    {
> +    /* (re-indent) */
???

>  	// -------- USLEEP + SOFTSLEEP -----------
>  	float min=softsleep?0.021:0.005;

also, i would prefer either not moving or moving teh whole timer block of
mplayer.c
don't combine the iterated inaccurate usleep() block with the accurate
RTC-based timing code.

maybe it's better to left it as-is for now, as it needs some rethinking of
teh timer stuff design to do it well. i'm against of messy partial
solutions, even if they are better than now, if we decide to change it then
do it well.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list