Merge pull request #4410 from FernetMenta/res
authorjmarshallnz <jcmarsha@gmail.com>
Thu, 13 Mar 2014 22:46:16 +0000 (11:46 +1300)
committerJonathan Marshall <jmarshall@xbmc.org>
Fri, 14 Mar 2014 21:51:30 +0000 (10:51 +1300)
fix switching refresh rates

xbmc/windowing/WinSystem.cpp

index 4be40ff..3ca5677 100644 (file)
@@ -129,7 +129,8 @@ static void AddResolution(vector<RESOLUTION_WHR> &resolutions, unsigned int addi
   int flags  = resInfo.dwFlags & D3DPRESENTFLAG_MODEMASK;
   float refreshrate = resInfo.fRefreshRate;
 
-  for (unsigned int idx = 0; idx < resolutions.size(); idx++)
+  // don't touch RES_DESKTOP
+  for (unsigned int idx = 1; idx < resolutions.size(); idx++)
     if (   resolutions[idx].width == width
         && resolutions[idx].height == height
         &&(resolutions[idx].flags & D3DPRESENTFLAG_MODEMASK) == flags)
@@ -137,8 +138,7 @@ static void AddResolution(vector<RESOLUTION_WHR> &resolutions, unsigned int addi
       // check if the refresh rate of this resolution is better suited than
       // the refresh rate of the resolution with the same width/height/interlaced
       // property and if so replace it
-      // don't touch RES_DESKTOP
-      if (idx != 0 && bestRefreshrate > 0.0 && refreshrate == bestRefreshrate)
+      if (bestRefreshrate > 0.0 && refreshrate == bestRefreshrate)
         resolutions[idx].ResInfo_Index = addindex;
 
       // no need to add the resolution again