Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
[rbp] fixed broken omx output buffer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
huceke committed Mar 26, 2012
1 parent c53c945 commit 9ab5d08
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions xbmc/cores/omxplayer/OMXTexture.cpp
Expand Up @@ -28,6 +28,7 @@
#include "OMXTexture.h"

#include "OMXStreamInfo.h"
#include "OMXClock.h"
#include "utils/log.h"
#include "linux/XMemUtils.h"

Expand Down Expand Up @@ -117,6 +118,8 @@ int COMXTexture::Decode(COMXImage *omx_image, void *egl_image, void *egl_display
unsigned int demuxer_bytes = 0;
const uint8_t *demuxer_content = NULL;
OMX_ERRORTYPE omx_err = OMX_ErrorNone;
OMX_BUFFERHEADERTYPE* m_output_buffer;
int nTimeOut = 0;

if(!m_is_open || !omx_image)
return false;
Expand Down Expand Up @@ -346,9 +349,20 @@ int COMXTexture::Decode(COMXImage *omx_image, void *egl_image, void *egl_display
goto do_exit;
}

OMX_BUFFERHEADERTYPE* m_output_buffer;
// 2000ms - this has to wait for jpeg decode, so could take a while
m_output_buffer=m_omx_egl_render.GetOutputBuffer(2000);
while(nTimeOut < 2000)
{
m_output_buffer=m_omx_egl_render.GetOutputBuffer(2000);
if (!m_output_buffer) {
OMXClock::OMXSleep(50);
nTimeOut += 50;
}
else
{
break;
}
}

if (!m_output_buffer) {
CLog::Log(LOGERROR, "%s::%s error m_omx_egl_render.GetOutputBuffer\n", CLASSNAME, __func__);
goto do_exit;
Expand Down

0 comments on commit 9ab5d08

Please sign in to comment.