Skip to content

Commit

Permalink
egl: Treat unknown display aspect ratio as square pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Apr 8, 2015
1 parent f2b1f26 commit 47c249c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector<RESOLUTION_INFO> &r
m_desktopRes.iScreenWidth = tv_state.display.hdmi.width;
m_desktopRes.iScreenHeight= tv_state.display.hdmi.height;
m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode);
m_desktopRes.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight);
m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight);
// Also add 3D flags
if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF)
{
Expand All @@ -474,7 +474,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector<RESOLUTION_INFO> &r
m_desktopRes.iScreenHeight= tv_state.display.sdtv.height;
m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED;
m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate;
m_desktopRes.fPixelRatio = get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight);
m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight);
}

SetResolutionString(m_desktopRes);
Expand Down

0 comments on commit 47c249c

Please sign in to comment.