Skip to content
This repository
Browse code

[rbp] changed limit jpeg decoding to half width and height. this is a…

… workaround for the PI's limited memory
  • Loading branch information...
commit d70dee6ab10948c15d56e73bef55e18799c641cd 1 parent bedd4af
huceke huceke authored

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

  1. +4 4 xbmc/guilib/Texture.cpp
8 xbmc/guilib/Texture.cpp
@@ -244,8 +244,8 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
244 244
245 245 if(omx_image.ReadFile(texturePath))
246 246 {
247   - //if(omx_image.Decode(maxWidth, maxHeight))
248   - if(omx_image.Decode(omx_image.GetWidth(), omx_image.GetHeight()))
  247 + // TODO: we only decode as half width and height. this is a workaround for the PI memory limitation
  248 + if(omx_image.Decode(omx_image.GetWidth() / 2, omx_image.GetHeight() / 2))
249 249 {
250 250 if (originalWidth)
251 251 *originalWidth = omx_image.GetOriginalWidth();
@@ -268,8 +268,8 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
268 268
269 269 if(omx_image.GetDecodedData())
270 270 {
271   - int size = ( (GetPitch() * GetRows() * 4 ) < omx_image.GetDecodedSize() ) ?
272   - GetPitch() * GetRows() * 4 : omx_image.GetDecodedSize();
  271 + int size = ( (GetPitch() * GetRows() ) < omx_image.GetDecodedSize() ) ?
  272 + GetPitch() * GetRows() : omx_image.GetDecodedSize();
273 273
274 274 memcpy(m_pixels, (unsigned char *)omx_image.GetDecodedData(), size);
275 275 }

0 comments on commit d70dee6

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