[mythtv-commits] Ticket #7874: nvidia refresh rate detection uses locale-aware strtod() function
MythTV
mythtv at cvs.mythtv.org
Thu Jan 7 20:53:38 UTC 2010
#7874: nvidia refresh rate detection uses locale-aware strtod() function
---------------------------------------------+------------------------------
Reporter: René H. Larsen <rhl@…> | Owner: janne
Type: defect | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - Video Playback | Version: 0.22-fixes
Severity: low | Mlocked: 0
---------------------------------------------+------------------------------
I'm using MythTV 0.22-fixes with VDPAU on a GT 220 GPU connected via HDMI
to a Samsung UE46B7070 TV.
I've noticed that MythTV reports inaccurate refresh rates for the modes
supported by my TV. For instance, the refresh rate of the 1920x1080_50
mode is reported as 49.832Hz. This causes MythTV to choose the wrong
display mode in some cases (eg. 720p50 material displayed at 60Hz).
I've tracked down the problem to the use of `strtod()` for parsing the
`dcl` value of the modeline in `libmythui/util-nvctrl.cpp`.
I'm in a part of the world (Denmark) that uses "," as the decimal point,
while the modeline reported by the nvidia driver uses ".". The locale-
aware `strtod()` function mis-parses the value, effectively rounding it
down to the nearest integer.
My solution is to use a C++ `stringstream` imbued with the "C" locale for
parsing that part of the modeline. See the attached patch.
I believe this fix may make [changeset:23023] redundant.
A workaround for those affected, who don't want to recompile MythTV, is to
set `LC_NUMERIC=C` when starting the frontend, thus overriding the default
locale with respect to parsing and displaying numeric values:
{{{
LC_NUMERIC=C mythfrontend
}}}
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/7874>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list