[mythtv-users] Setting specific xrandr mode based on the file's refresh rate

Boleslaw Ciesielski bolek-mythtv at curl.com
Tue Feb 17 04:10:04 UTC 2009


Jean-Yves Avenard wrote:
> I'm sure there should be a way to determine what the real refresh
> rate is  from the xrandr ; but I haven't found how yet.

See the source for xrandr utility (xrandr.c). I think it has everything 
you need. In fact

xrandr --verbose

displays a list of modelines with the fake refresh rates. The real 
refresh rates can be computed from the fields in XRRModeInfo. There is 
even a function that does just that:

/* v refresh frequency in Hz */
static float
mode_refresh (XRRModeInfo *mode_info)
{
     float rate;

     if (mode_info->hTotal && mode_info->vTotal)
	rate = ((float) mode_info->dotClock /
		((float) mode_info->hTotal * (float) mode_info->vTotal));
     else
     	rate = 0;
     return rate;
}

Bolek


More information about the mythtv-users mailing list