Ticket #7874: util-nvctrl-refresh-rate-fix.patch

File util-nvctrl-refresh-rate-fix.patch, 1.0 KB (added by René H. Larsen <rhl@…>, 11 years ago)

Fix nvidia refresh rate detection for some non-english locales

  • mythtv-0.22.0-fixes23069/libs/libmythui/util-nvctrl.cpp

    diff -up mythtv-0.22.0-fixes23069/libs/libmythui/util-nvctrl.cpp.orig mythtv-0.22.0-fixes23069/libs/libmythui/util-nvctrl.cpp
    old new  
    88#include <string.h>
    99#include <ctype.h>
    1010#include <cmath>
     11#include <sstream>
     12#include <locale>
    1113
    1214#include "mythxdisplay.h"
    1315
    int GetNvidiaRates(t_screenrate& screenm 
    211213                    vfl = strtol(buf[8], NULL, 10);
    212214                    hfl = strtol(buf[4], NULL, 10);
    213215                    h = strtol(buf[5], NULL, 10);
    214                     dcl = strtod(buf[0], NULL);
     216                    istringstream istr(buf[0]);
     217                    istr.imbue(locale("C"));
     218                    istr >> dcl;
    215219                    r = (dcl * 1000000.0) / (vfl * hfl);
    216220                    irate = (int) round(r * 1000.0);
    217221                    key = DisplayResScreen::CalcKey(w, h, (double) id);