Opened 16 years ago
Closed 16 years ago
Last modified 16 years ago
#7874 closed defect (fixed)
nvidia refresh rate detection uses locale-aware strtod() function
| Reported by: | Owned by: | Janne Grunau | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.23 |
| Component: | MythTV - Video Playback | Version: | 0.22-fixes |
| Severity: | low | Keywords: | |
| Cc: | Ticket locked: | no |
Description
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 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
Attachments (1)
Change History (6)
by , 16 years ago
| Attachment: | util-nvctrl-refresh-rate-fix.patch added |
|---|
comment:1 by , 16 years ago
| Milestone: | unknown → 0.23 |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 16 years ago
| Owner: | changed from to |
|---|
comment:3 by , 16 years ago
| Owner: | changed from to |
|---|---|
| Status: | assigned → accepted |
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |

Fix nvidia refresh rate detection for some non-english locales