Skip to content

Commit

Permalink
[rbp] changed limit jpeg decoding to half width and height. this is a…
Browse files Browse the repository at this point in the history
… workaround for the PI's limited memory
  • Loading branch information
huceke committed Aug 12, 2012
1 parent bedd4af commit d70dee6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xbmc/guilib/Texture.cpp
Expand Up @@ -244,8 +244,8 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW


if(omx_image.ReadFile(texturePath)) if(omx_image.ReadFile(texturePath))
{ {
//if(omx_image.Decode(maxWidth, maxHeight)) // TODO: we only decode as half width and height. this is a workaround for the PI memory limitation
if(omx_image.Decode(omx_image.GetWidth(), omx_image.GetHeight())) if(omx_image.Decode(omx_image.GetWidth() / 2, omx_image.GetHeight() / 2))
{ {
if (originalWidth) if (originalWidth)
*originalWidth = omx_image.GetOriginalWidth(); *originalWidth = omx_image.GetOriginalWidth();
Expand All @@ -268,8 +268,8 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW


if(omx_image.GetDecodedData()) if(omx_image.GetDecodedData())
{ {
int size = ( (GetPitch() * GetRows() * 4 ) < omx_image.GetDecodedSize() ) ? int size = ( (GetPitch() * GetRows() ) < omx_image.GetDecodedSize() ) ?
GetPitch() * GetRows() * 4 : omx_image.GetDecodedSize(); GetPitch() * GetRows() : omx_image.GetDecodedSize();


memcpy(m_pixels, (unsigned char *)omx_image.GetDecodedData(), size); memcpy(m_pixels, (unsigned char *)omx_image.GetDecodedData(), size);
} }
Expand Down

0 comments on commit d70dee6

Please sign in to comment.