diff options
author | Andreas Huber <andih@google.com> | 2012-10-01 16:03:44 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-10-01 16:03:44 -0700 |
commit | af5dd7753e62353411cf0daf3b513c38818e9662 (patch) | |
tree | e935f45f925c4ce6d35d16764e2d40db69cc954a /media/libstagefright/rtsp | |
parent | 0868deae404604b577892413c128d55a2bafc56e (diff) | |
download | frameworks_av-af5dd7753e62353411cf0daf3b513c38818e9662.zip frameworks_av-af5dd7753e62353411cf0daf3b513c38818e9662.tar.gz frameworks_av-af5dd7753e62353411cf0daf3b513c38818e9662.tar.bz2 |
ALooper::GetNowUs() now relies on systemTime instead of gettimeofday.
Change-Id: Ia31eb0940b02581327a8bf51af6df135f9ab6de3
related-to-bug: 7266324
Diffstat (limited to 'media/libstagefright/rtsp')
-rw-r--r-- | media/libstagefright/rtsp/ARTPAssembler.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/media/libstagefright/rtsp/ARTPAssembler.cpp b/media/libstagefright/rtsp/ARTPAssembler.cpp index 1844bc5..c7a65c2 100644 --- a/media/libstagefright/rtsp/ARTPAssembler.cpp +++ b/media/libstagefright/rtsp/ARTPAssembler.cpp @@ -18,19 +18,13 @@ #include <media/stagefright/foundation/ABuffer.h> #include <media/stagefright/foundation/ADebug.h> +#include <media/stagefright/foundation/ALooper.h> #include <media/stagefright/foundation/AMessage.h> #include <stdint.h> namespace android { -static int64_t getNowUs() { - struct timeval tv; - gettimeofday(&tv, NULL); - - return (int64_t)tv.tv_usec + tv.tv_sec * 1000000ll; -} - ARTPAssembler::ARTPAssembler() : mFirstFailureTimeUs(-1) { } @@ -42,7 +36,7 @@ void ARTPAssembler::onPacketReceived(const sp<ARTPSource> &source) { if (status == WRONG_SEQUENCE_NUMBER) { if (mFirstFailureTimeUs >= 0) { - if (getNowUs() - mFirstFailureTimeUs > 10000ll) { + if (ALooper::GetNowUs() - mFirstFailureTimeUs > 10000ll) { mFirstFailureTimeUs = -1; // LOG(VERBOSE) << "waited too long for packet."; @@ -50,7 +44,7 @@ void ARTPAssembler::onPacketReceived(const sp<ARTPSource> &source) { continue; } } else { - mFirstFailureTimeUs = getNowUs(); + mFirstFailureTimeUs = ALooper::GetNowUs(); } break; } else { |