Skip to content
This repository
Browse code

Merge pull request #2044 from popcornmix/clamped_resolution_fix

Fix for incorrectly using clamped resolution when looking for framerate match
  • Loading branch information...
commit 687b3ec0949d57ed8f8f78606e751c64c64625b4 2 parents a72b57b + f55cbbf
davilla authored January 10, 2013

Showing 1 changed file with 16 additions and 16 deletions. Show diff stats Hide diff stats

  1. 32  xbmc/cores/VideoRenderers/BaseRenderer.cpp
32  xbmc/cores/VideoRenderers/BaseRenderer.cpp
@@ -106,9 +106,9 @@ bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fa
106 106
 
107 107
     for (size_t j = (int)RES_DESKTOP; j < g_settings.m_ResInfo.size(); j++)
108 108
     {
109  
-      if (g_settings.m_ResInfo[j].iWidth  == g_settings.m_ResInfo[m_resolution].iWidth
110  
-       && g_settings.m_ResInfo[j].iHeight == g_settings.m_ResInfo[m_resolution].iHeight
111  
-       && g_settings.m_ResInfo[j].iScreen == g_settings.m_ResInfo[m_resolution].iScreen)
  109
+      if (g_settings.m_ResInfo[j].iScreenWidth  == g_settings.m_ResInfo[m_resolution].iScreenWidth
  110
+       && g_settings.m_ResInfo[j].iScreenHeight == g_settings.m_ResInfo[m_resolution].iScreenHeight
  111
+       && g_settings.m_ResInfo[j].iScreen       == g_settings.m_ResInfo[m_resolution].iScreen)
112 112
       {
113 113
         if (g_settings.m_ResInfo[j].fRefreshRate <= override.refreshmax
114 114
          && g_settings.m_ResInfo[j].fRefreshRate >= override.refreshmin)
@@ -161,9 +161,9 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight)
161 161
       for (size_t i = (int)RES_DESKTOP; i < g_settings.m_ResInfo.size(); i++)
162 162
       {
163 163
         if (MathUtils::round_int(g_settings.m_ResInfo[i].fRefreshRate) == 60
164  
-         && g_settings.m_ResInfo[i].iWidth  == g_settings.m_ResInfo[m_resolution].iWidth
165  
-         && g_settings.m_ResInfo[i].iHeight == g_settings.m_ResInfo[m_resolution].iHeight
166  
-         && g_settings.m_ResInfo[i].iScreen == g_settings.m_ResInfo[m_resolution].iScreen)
  164
+         && g_settings.m_ResInfo[i].iScreenWidth  == g_settings.m_ResInfo[m_resolution].iScreenWidth
  165
+         && g_settings.m_ResInfo[i].iScreenHeight == g_settings.m_ResInfo[m_resolution].iScreenHeight
  166
+         && g_settings.m_ResInfo[i].iScreen       == g_settings.m_ResInfo[m_resolution].iScreen)
167 167
         {
168 168
           if (fabs(g_settings.m_ResInfo[i].fRefreshRate - 60.0) < fabs(g_settings.m_ResInfo[m_resolution].fRefreshRate - 60.0))
169 169
             m_resolution = (RESOLUTION)i;
@@ -176,10 +176,10 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight)
176 176
         CLog::Log(LOGDEBUG, "60 hertz refreshrate not available, choosing highest");
177 177
         for (size_t i = (int)RES_DESKTOP; i < g_settings.m_ResInfo.size(); i++)
178 178
         {
179  
-          if (g_settings.m_ResInfo[i].fRefreshRate >  g_settings.m_ResInfo[m_resolution].fRefreshRate
180  
-           && g_settings.m_ResInfo[i].iWidth       == g_settings.m_ResInfo[m_resolution].iWidth
181  
-           && g_settings.m_ResInfo[i].iHeight      == g_settings.m_ResInfo[m_resolution].iHeight
182  
-           && g_settings.m_ResInfo[i].iScreen      == g_settings.m_ResInfo[m_resolution].iScreen)
  179
+          if (g_settings.m_ResInfo[i].fRefreshRate  >  g_settings.m_ResInfo[m_resolution].fRefreshRate
  180
+           && g_settings.m_ResInfo[i].iScreenWidth  == g_settings.m_ResInfo[m_resolution].iScreenWidth
  181
+           && g_settings.m_ResInfo[i].iScreenHeight == g_settings.m_ResInfo[m_resolution].iScreenHeight
  182
+           && g_settings.m_ResInfo[i].iScreen       == g_settings.m_ResInfo[m_resolution].iScreen)
183 183
           {
184 184
             m_resolution = (RESOLUTION)i;
185 185
           }
@@ -195,8 +195,8 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES
195 195
 {
196 196
   RESOLUTION_INFO &curr = g_settings.m_ResInfo[current];
197 197
 
198  
-  int iWidth  = curr.iWidth;
199  
-  int iHeight = curr.iHeight;
  198
+  int iScreenWidth  = curr.iScreenWidth;
  199
+  int iScreenHeight = curr.iScreenHeight;
200 200
   float fRefreshRate = fps;
201 201
 
202 202
   /*
@@ -216,12 +216,12 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES
216 216
 
217 217
   if(m_iFlags & CONF_FLAGS_FORMAT_SBS)
218 218
   {
219  
-    iWidth /= 2;
  219
+    iScreenWidth /= 2;
220 220
     fRefreshRate *= 2;
221 221
   }
222 222
   else if(m_iFlags & CONF_FLAGS_FORMAT_TB)
223 223
   {
224  
-    iHeight /= 2;
  224
+    iScreenHeight /= 2;
225 225
     fRefreshRate *= 2;
226 226
   }
227 227
 
@@ -235,8 +235,8 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES
235 235
 
236 236
     //discard resolutions that are not the same width and height
237 237
     //or have a too low refreshrate
238  
-    if (info.iWidth  != iWidth
239  
-    ||  info.iHeight != iHeight
  238
+    if (info.iScreenWidth  != iScreenWidth
  239
+    ||  info.iScreenHeight != iScreenHeight
240 240
     ||  info.iScreen != curr.iScreen
241 241
     ||  info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001)
242 242
       continue;

0 notes on commit 687b3ec

Please sign in to comment.
Something went wrong with that request. Please try again.