diff options
author | Phil Burk <philburk@google.com> | 2015-04-30 16:18:53 -0700 |
---|---|---|
committer | Phil Burk <philburk@google.com> | 2015-05-01 10:32:54 -0700 |
commit | 4c5a3675ed6b429dfaa2707acf2b3faf2808baf2 (patch) | |
tree | b0697130f34c1957f26b84f74d00fb8455890fae /media/libmedia/AudioTrack.cpp | |
parent | 1de1e25cba872bd4c077c2e394f8ca9c70b65856 (diff) | |
download | frameworks_av-4c5a3675ed6b429dfaa2707acf2b3faf2808baf2.zip frameworks_av-4c5a3675ed6b429dfaa2707acf2b3faf2808baf2.tar.gz frameworks_av-4c5a3675ed6b429dfaa2707acf2b3faf2808baf2.tar.bz2 |
AudioTrack: reduce retrograde motion spew
Change-Id: I96aced52b136ceea924aa3d9ef56374dd4c49784
Signed-off-by: Phil Burk <philburk@google.com>
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 76d9169..bb47d3e 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -2227,11 +2227,18 @@ status_t AudioTrack::getTimestamp(AudioTimestamp& timestamp) - mPreviousTimestamp.mPosition); // position can bobble slightly as an artifact; this hides the bobble static const int32_t MINIMUM_POSITION_DELTA = 8; - ALOGW_IF(deltaPosition < 0, - "retrograde timestamp position corrected, %d = %u - %u", - deltaPosition, - timestamp.mPosition, - mPreviousTimestamp.mPosition); + if (deltaPosition < 0) { + // Only report once per position instead of spamming the log. + if (!mRetrogradeMotionReported) { + ALOGW("retrograde timestamp position corrected, %d = %u - %u", + deltaPosition, + timestamp.mPosition, + mPreviousTimestamp.mPosition); + mRetrogradeMotionReported = true; + } + } else { + mRetrogradeMotionReported = false; + } if (deltaPosition < MINIMUM_POSITION_DELTA) { timestamp = mPreviousTimestamp; // Use last valid timestamp. } |