diff options
author | Glenn Kasten <gkasten@google.com> | 2012-09-24 11:29:00 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-09-24 11:48:20 -0700 |
commit | 80b3273cea8660fe8a5868d024d2788a1e083ffc (patch) | |
tree | e9d4e782be64fe03b80331cf62f98ca27c16be6f | |
parent | 94a68ecf2b56bd56994d0352cbaad56e58dcf0dc (diff) | |
download | frameworks_av-80b3273cea8660fe8a5868d024d2788a1e083ffc.zip frameworks_av-80b3273cea8660fe8a5868d024d2788a1e083ffc.tar.gz frameworks_av-80b3273cea8660fe8a5868d024d2788a1e083ffc.tar.bz2 |
Check clock_gettime(CLOCK_MONOTONIC) for failure
Bug: 7100774
Change-Id: I15a84a19bb6d6ef1d9dac4beaa03587638196404
-rw-r--r-- | media/libnbaio/MonoPipe.cpp | 3 | ||||
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/media/libnbaio/MonoPipe.cpp b/media/libnbaio/MonoPipe.cpp index c426efb..bbdc8c1 100644 --- a/media/libnbaio/MonoPipe.cpp +++ b/media/libnbaio/MonoPipe.cpp @@ -163,6 +163,9 @@ ssize_t MonoPipe::write(const void *buffer, size_t count) if (nowTsValid && mWriteTsValid) { time_t sec = nowTs.tv_sec - mWriteTs.tv_sec; long nsec = nowTs.tv_nsec - mWriteTs.tv_nsec; + ALOGE_IF(sec < 0 || (sec == 0 && nsec < 0), + "clock_gettime(CLOCK_MONOTONIC) failed: was %ld.%09ld but now %ld.%09ld", + mWriteTs.tv_sec, mWriteTs.tv_nsec, nowTs.tv_sec, nowTs.tv_nsec); if (nsec < 0) { --sec; nsec += 1000000000; diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 13003d9..3c8a256 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -454,6 +454,9 @@ bool FastMixer::threadLoop() if (oldTsValid) { time_t sec = newTs.tv_sec - oldTs.tv_sec; long nsec = newTs.tv_nsec - oldTs.tv_nsec; + ALOGE_IF(sec < 0 || (sec == 0 && nsec < 0), + "clock_gettime(CLOCK_MONOTONIC) failed: was %ld.%09ld but now %ld.%09ld", + oldTs.tv_sec, oldTs.tv_nsec, newTs.tv_sec, newTs.tv_nsec); if (nsec < 0) { --sec; nsec += 1000000000; |