diff options
author | peak3d <pfau@peak3d.de> | 2019-04-09 22:14:28 +0200 |
---|---|---|
committer | peak3d <pfau@peak3d.de> | 2019-04-09 22:14:28 +0200 |
commit | ace7269be3af65ae927c9233e295cc7c45008c18 (patch) | |
tree | 817e200e523086bcc6778022d151c657ecac3652 | |
parent | b8679c0b19aaa91057f0fb3ca386cc24d8f445e2 (diff) |
Fix pixelstore usage
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp index c8a5b6b456..39e3866fac 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp @@ -279,23 +279,28 @@ void CLinuxRendererGLES::LoadPlane(CYuvPlane& plane, int type, glBindTexture(m_textureTarget, plane.id); - if (m_pixelStoreKey > 0) + bool pixelStoreChanged = false; + if (stride != static_cast<int>(width * bps)) { - glPixelStorei(m_pixelStoreKey, stride); - } - else if (stride != static_cast<int>(width * bps)) - { - unsigned char *src(static_cast<unsigned char*>(data)), - *dst(m_planeBuffer); + if (m_pixelStoreKey > 0) + { + pixelStoreChanged = true; + glPixelStorei(m_pixelStoreKey, stride); + } + else + { + unsigned char *src(static_cast<unsigned char*>(data)), + *dst(m_planeBuffer); - for (unsigned int y = 0; y < height; ++y, src += stride, dst += width * bpp) - memcpy(dst, src, width * bpp); + for (unsigned int y = 0; y < height; ++y, src += stride, dst += width * bpp) + memcpy(dst, src, width * bpp); - pixelData = m_planeBuffer; + pixelData = m_planeBuffer; + } } glTexSubImage2D(m_textureTarget, 0, 0, 0, width, height, type, GL_UNSIGNED_BYTE, pixelData); - if (m_pixelStoreKey > 0) + if (m_pixelStoreKey > 0 && pixelStoreChanged) glPixelStorei(m_pixelStoreKey, 0); // check if we need to load any border pixels |