Skip to content

Commit

Permalink
mmalcodec: Also wake up decoder when a new input buffer is available
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed May 12, 2016
1 parent 82d0f72 commit 656a69d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ void CMMALVideo::dec_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buff
if (g_advancedSettings.CanLogComponent(LOGVIDEO))
CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd);
mmal_buffer_header_release(buffer);
CSingleLock lock(m_output_mutex);
m_output_cond.notifyAll();
}

static void dec_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
Expand Down Expand Up @@ -865,9 +867,10 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts)
slept = true;
{
// otherwise we busy spin
CSingleExit unlock(m_sharedSection);
CSingleLock lock(m_output_mutex);
m_output_cond.wait(lock, 30);
lock.Leave();
CSingleLock output_lock(m_output_mutex);
m_output_cond.wait(output_lock, 30);
lock.Enter();
}
if (!m_output_ready.empty())
ret |= VC_PICTURE;
Expand Down

0 comments on commit 656a69d

Please sign in to comment.