Skip to content
Permalink
Browse files

Revert "omxcore: Pause components when flushing"

This reverts commit 794010c859bd7c777dfa9e345bd6cef0cd642b4c.
  • Loading branch information
popcornmix committed Jan 16, 2016
1 parent 915f483 commit f5102d7d20b49eebf3f4fc9edf921aabbf6c3796
Showing with 8 additions and 37 deletions.
  1. +2 −2 xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
  2. +2 −2 xbmc/cores/omxplayer/OMXAudio.cpp
  3. +4 −33 xbmc/linux/OMXCore.cpp
@@ -377,9 +377,9 @@ void CAESinkPi::Deinitialize()
if ( m_omx_splitter.IsInitialized() )
m_omx_splitter.FlushAll();
if ( m_omx_render.IsInitialized() )
m_omx_render.FlushInput();
m_omx_render.FlushAll();
if ( m_omx_render_slave.IsInitialized() )
m_omx_render_slave.FlushInput();
m_omx_render_slave.FlushAll();

if ( m_omx_splitter.IsInitialized() )
m_omx_splitter.Deinitialize();
@@ -974,9 +974,9 @@ void COMXAudio::Flush()
m_omx_splitter.FlushAll();

if ( m_omx_render_analog.IsInitialized() )
m_omx_render_analog.FlushInput();
m_omx_render_analog.FlushAll();
if ( m_omx_render_hdmi.IsInitialized() )
m_omx_render_hdmi.FlushInput();
m_omx_render_hdmi.FlushAll();

m_last_pts = DVD_NOPTS_VALUE;
m_submitted = 0.0f;
@@ -414,41 +414,15 @@ OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffer(OMX_BUFFERHEADERTYPE *omx_buff

void COMXCoreComponent::FlushAll()
{
if(!m_handle || m_resource_error)
return;

assert(GetState() == OMX_StateExecuting);
SetStateForComponent(OMX_StatePause);

OMX_ERRORTYPE omx_err = OMX_SendCommand(m_handle, OMX_CommandFlush, m_input_port, NULL);

if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "COMXCoreComponent::FlushInput - Error on component %s omx_err(0x%08x)",
m_componentName.c_str(), (int)omx_err);
}
omx_err = OMX_SendCommand(m_handle, OMX_CommandFlush, m_output_port, NULL);

if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "COMXCoreComponent::FlushOutput - Error on component %s omx_err(0x%08x)",
m_componentName.c_str(), (int)omx_err);
}

WaitForCommand(OMX_CommandFlush, m_input_port);
WaitForCommand(OMX_CommandFlush, m_output_port);

SetStateForComponent(OMX_StateExecuting);
FlushInput();
FlushOutput();
}

void COMXCoreComponent::FlushInput()
{
if(!m_handle || m_resource_error)
return;

assert(GetState() == OMX_StateExecuting);
SetStateForComponent(OMX_StatePause);

OMX_ERRORTYPE omx_err = OMX_SendCommand(m_handle, OMX_CommandFlush, m_input_port, NULL);

if(omx_err != OMX_ErrorNone)
@@ -457,17 +431,13 @@ void COMXCoreComponent::FlushInput()
m_componentName.c_str(), (int)omx_err);
}
WaitForCommand(OMX_CommandFlush, m_input_port);
SetStateForComponent(OMX_StateExecuting);
}

void COMXCoreComponent::FlushOutput()
{
if(!m_handle || m_resource_error)
return;

assert(GetState() == OMX_StateExecuting);
SetStateForComponent(OMX_StatePause);

OMX_ERRORTYPE omx_err = OMX_SendCommand(m_handle, OMX_CommandFlush, m_output_port, NULL);

if(omx_err != OMX_ErrorNone)
@@ -476,7 +446,6 @@ void COMXCoreComponent::FlushOutput()
m_componentName.c_str(), (int)omx_err);
}
WaitForCommand(OMX_CommandFlush, m_output_port);
SetStateForComponent(OMX_StateExecuting);
}

// timeout in milliseconds
@@ -1484,6 +1453,8 @@ bool COMXCoreComponent::Deinitialize()

if(m_handle)
{
FlushAll();

FreeOutputBuffers();
FreeInputBuffers();

0 comments on commit f5102d7

Please sign in to comment.
You can’t perform that action at this time.