From 3ad56849c844760dd8317a13f2a2b8b69f3feabc Mon Sep 17 00:00:00 2001 From: Thomas Reufer Date: Fri, 26 Sep 2014 10:09:19 +0200 Subject: avoid flushing OMX video chain twice when calling SetPlayMode(pmNone) --- omxdevice.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/omxdevice.c b/omxdevice.c index 88d6639..23a6475 100644 --- a/omxdevice.c +++ b/omxdevice.c @@ -146,8 +146,18 @@ bool cOmxDevice::SetPlayMode(ePlayMode PlayMode) switch (PlayMode) { case pmNone: - FlushStreams(true); - m_omx->StopVideo(); + m_omx->StopClock(); + m_omx->SetClockScale(0.0f); + + if (m_hasVideo) + m_omx->StopVideo(); + + if (m_hasAudio) + { + m_audio->Reset(); + m_omx->FlushAudio(); + } + m_omx->SetCurrentReferenceTime(0); m_omx->SetClockReference(cOmx::eClockRefVideo); m_videoCodec = cVideoCodec::eInvalid; m_hasAudio = false; -- cgit v1.2.3