Advertisement
Guest User

xbmc-996.00-accurate-aspect-ratio.patch

a guest
Jan 18th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.27 KB | None | 0 0
  1. commit d6f758f103888cd1b92e6e8dcc7b9d27203f26ef
  2. Author: Lauri Myllari <lauri.myllari@gmail.com>
  3. Date:   Fri Jan 17 15:44:25 2014 -0800
  4.  
  5.     [X11] Use exact aspect ratio for 16:9 and 4:3 displays
  6.  
  7. diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
  8. index c95f4ec..43aa737 100644
  9. --- a/xbmc/windowing/X11/WinSystemX11.cpp
  10. +++ b/xbmc/windowing/X11/WinSystemX11.cpp
  11. @@ -373,8 +373,18 @@ void CWinSystemX11::UpdateResolutions()
  12.          res.iWidth  = mode.h;
  13.          res.iHeight = mode.w;
  14.        }
  15. -      if (mode.h>0 && mode.w>0 && out->hmm>0 && out->wmm>0)
  16. -        res.fPixelRatio = ((float)out->wmm/(float)mode.w) / (((float)out->hmm/(float)mode.h));
  17. +      if (mode.h>0 && mode.w>0 && out->hmm>0 && out->wmm>0) {
  18. +        float aspectx, aspecty;
  19. +        float phyaspect = (float)out->wmm / (float)out->hmm;
  20. +        if (fabs(1-((16.0/9)/phyaspect)) < 0.01) {
  21. +          aspectx = 16.0; aspecty = 9.0;
  22. +        } else if (fabs(1-((4.0/3)/phyaspect)) < 0.01) {
  23. +          aspectx = 4.0; aspecty = 3.0;
  24. +        } else {
  25. +          aspectx = (float)out->wmm; aspecty = (float)out->hmm;
  26. +        }
  27. +        res.fPixelRatio = (aspectx/(float)mode.w) / ((aspecty/(float)mode.h));
  28. +      }
  29.        else
  30.          res.fPixelRatio = 1.0f;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement