Permalink
Browse files

[omximage] Don't report failed decode of progressive jpegs as as error

  • Loading branch information...
popcornmix committed Jun 1, 2015
1 parent e5fb409 commit c5f27a35f47542861025274c0f0a3b16478d4814
Showing with 10 additions and 16 deletions.
  1. +10 −16 xbmc/cores/omxplayer/OMXImage.cpp
@@ -601,7 +601,10 @@ OMX_IMAGE_CODINGTYPE COMXImageFile::GetCodingType(unsigned int &width, unsigned
m_orientation = 0;
if(!m_image_size)
{
CLog::Log(LOGERROR, "%s::%s %s m_image_size unexpected (%lu)\n", CLASSNAME, __func__, m_filename, m_image_size);
return OMX_IMAGE_CodingMax;
}
uint8_t *p = m_image_buffer;
uint8_t *q = m_image_buffer + m_image_size;
@@ -848,17 +851,14 @@ OMX_IMAGE_CODINGTYPE COMXImageFile::GetCodingType(unsigned int &width, unsigned
}
}
else
CLog::Log(LOGERROR, "%s::%s error unsupported image format\n", CLASSNAME, __func__);
// apply input orientation
m_orientation = m_orientation ^ orientation;
if(m_orientation < 0 || m_orientation >= 8)
m_orientation = 0;
if(eCompressionFormat == OMX_IMAGE_CodingMax)
{
CLog::Log(LOGERROR, "%s::%s error unsupported image format\n", CLASSNAME, __func__);
}
if(progressive)
{
CLog::Log(LOGWARNING, "%s::%s progressive images not supported by decoder\n", CLASSNAME, __func__);
@@ -881,7 +881,7 @@ bool COMXImageFile::ReadFile(const std::string& inputFile, int orientation)
m_filename = inputFile.c_str();
if(!m_pFile.Open(inputFile, 0))
{
CLog::Log(LOGERROR, "%s::%s %s not found\n", CLASSNAME, __func__, inputFile.c_str());
CLog::Log(LOGERROR, "%s::%s %s not found\n", CLASSNAME, __func__, m_filename);
return false;
}
@@ -893,29 +893,23 @@ bool COMXImageFile::ReadFile(const std::string& inputFile, int orientation)
if(!m_image_size)
{
CLog::Log(LOGERROR, "%s::%s %s m_image_size zero\n", CLASSNAME, __func__, inputFile.c_str());
CLog::Log(LOGERROR, "%s::%s %s m_image_size zero\n", CLASSNAME, __func__, m_filename);
return false;
}
m_image_buffer = (uint8_t *)malloc(m_image_size);
if(!m_image_buffer)
{
CLog::Log(LOGERROR, "%s::%s %s m_image_buffer null (%lu)\n", CLASSNAME, __func__, inputFile.c_str(), m_image_size);
CLog::Log(LOGERROR, "%s::%s %s m_image_buffer null (%lu)\n", CLASSNAME, __func__, m_filename, m_image_size);
return false;
}
m_pFile.Read(m_image_buffer, m_image_size);
m_pFile.Close();
OMX_IMAGE_CODINGTYPE eCompressionFormat = GetCodingType(m_width, m_height, orientation);
if(eCompressionFormat != OMX_IMAGE_CodingJPEG)
{
CLog::Log(LOGERROR, "%s::%s %s GetCodingType=0x%x\n", CLASSNAME, __func__, inputFile.c_str(), eCompressionFormat);
return false;
}
if(m_width < 1 || m_height < 1)
if(eCompressionFormat != OMX_IMAGE_CodingJPEG || m_width < 1 || m_height < 1)
{
CLog::Log(LOGERROR, "%s::%s %s m_width=%d m_height=%d\n", CLASSNAME, __func__, inputFile.c_str(), m_width, m_height);
CLog::Log(LOGDEBUG, "%s::%s %s GetCodingType=0x%x (%dx%x)\n", CLASSNAME, __func__, m_filename, eCompressionFormat, m_width, m_height);
return false;
}

0 comments on commit c5f27a3

Please sign in to comment.