diff options
author | Jianhong Jiang <jianhong@google.com> | 2009-09-29 12:25:37 -0700 |
---|---|---|
committer | Jianhong Jiang <jianhong@google.com> | 2009-09-29 12:25:37 -0700 |
commit | cbf599dded52d36dd285332f67edc6a726213f51 (patch) | |
tree | 33fe0b1b6e8969f761d2fd0c350dfd79a0fb6cc5 /android | |
parent | e7cf38634c50f605c6e8fb5277b9e50811bcc462 (diff) | |
download | opencore-cbf599dded52d36dd285332f67edc6a726213f51.tar.gz |
PVMFMediaClock takes care of device latency. Remove the device latency processing in AMIO.
Diffstat (limited to 'android')
-rw-r--r-- | android/android_audio_mio.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/android/android_audio_mio.cpp b/android/android_audio_mio.cpp index 165d683d5..d7e662594 100644 --- a/android/android_audio_mio.cpp +++ b/android/android_audio_mio.cpp @@ -711,18 +711,8 @@ void AndroidAudioMIOActiveTimingSupport::UpdateClock() updateClock32 = iFrameCount * iMsecsPerFrame; LOGV("sample clock = %u frameCount(%u) msecsPerFrame(%f)", updateClock32,iFrameCount,iMsecsPerFrame); - // startup - force clock backwards to compensate for latency - if (updateClock32 < iDriverLatency) { - LOGV("iStartTime = %u , iDriverLatency = %u",iStartTime, iDriverLatency); - correction = iStartTime - clockTime32; - LOGV("latency stall - forcing clock (correction = %d)",correction); - } - - // normal play mode - check delta between PV engine clock and sample clock - else { - correction = (updateClock32 - iDriverLatency) - (clockTime32 - iStartTime); - LOGV("clock drift (correction = (updateClock32(%d)-iDriverLatency(%d))-(clockTime32(%d)-iStartTime(%d))= %d)",updateClock32,iDriverLatency,clockTime32,iStartTime,correction); - } + correction = updateClock32 - (clockTime32 - iStartTime); + LOGV("ADJ_CLK iDriverLatency %d old clock %d delta %d", iDriverLatency, clockTime32, correction); // do clock correction if drift exceeds threshold if (OSCL_ABS(correction) > iMinCorrection) { @@ -732,7 +722,8 @@ void AndroidAudioMIOActiveTimingSupport::UpdateClock() correction = -iMaxCorrection; } updateClock32 = clockTime32 + correction; - LOGV("drift correction = %d, new clock = %u", correction, updateClock32); + LOGV("ADJ_CLK old clock %d correction %d new clock %d", clockTime32, correction, updateClock32); + PVMFMediaClockAdjustTimeStatus adjustmentstatus = iClock->AdjustClockTime32(clockTime32, timeBaseTime32, updateClock32,PVMF_MEDIA_CLOCK_MSEC,overflowFlag); |