summaryrefslogtreecommitdiff
path: root/omx.c
diff options
context:
space:
mode:
Diffstat (limited to 'omx.c')
-rw-r--r--omx.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/omx.c b/omx.c
index c201310..afc1f98 100644
--- a/omx.c
+++ b/omx.c
@@ -358,6 +358,7 @@ int cOmx::Init(void)
DBG("started with %d video and %d audio buffers",
m_freeVideoBuffers, m_freeAudioBuffers);
+ SetClockLatencyTarget();
SetBufferStall(1500);
FlushVideo();
@@ -612,6 +613,26 @@ void cOmx::SetClockReference(eClockReference clockReference)
}
}
+void cOmx::SetClockLatencyTarget(void)
+{
+ OMX_CONFIG_LATENCYTARGETTYPE latencyTarget;
+ OMX_INIT_STRUCT(latencyTarget);
+
+ // values set according reference implementation in omxplayer
+ latencyTarget.nPortIndex = OMX_ALL;
+ latencyTarget.bEnabled = OMX_TRUE;
+ latencyTarget.nFilter = 10;
+ latencyTarget.nTarget = 0;
+ latencyTarget.nShift = 3;
+ latencyTarget.nSpeedFactor = -200;
+ latencyTarget.nInterFactor = 100;
+ latencyTarget.nAdjCap = 100;
+
+ if (OMX_SetConfig(ILC_GET_HANDLE(m_comp[eClock]),
+ OMX_IndexConfigLatencyTarget, &latencyTarget) != OMX_ErrorNone)
+ ELOG("failed set clock latency target!");
+}
+
void cOmx::SetBufferStall(int delayMs)
{
if (delayMs > 0)