From af5dd7753e62353411cf0daf3b513c38818e9662 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Mon, 1 Oct 2012 16:03:44 -0700 Subject: ALooper::GetNowUs() now relies on systemTime instead of gettimeofday. Change-Id: Ia31eb0940b02581327a8bf51af6df135f9ab6de3 related-to-bug: 7266324 --- media/libstagefright/rtsp/ARTPAssembler.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'media/libstagefright/rtsp') 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 #include +#include #include #include 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 &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 &source) { continue; } } else { - mFirstFailureTimeUs = getNowUs(); + mFirstFailureTimeUs = ALooper::GetNowUs(); } break; } else { -- cgit v1.1