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/ThrottledSource.cpp | |
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/ThrottledSource.cpp')
-rw-r--r-- | media/libstagefright/ThrottledSource.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/media/libstagefright/ThrottledSource.cpp b/media/libstagefright/ThrottledSource.cpp index b1fcafd..348a9d3 100644 --- a/media/libstagefright/ThrottledSource.cpp +++ b/media/libstagefright/ThrottledSource.cpp @@ -17,16 +17,10 @@ #include "include/ThrottledSource.h" #include <media/stagefright/foundation/ADebug.h> +#include <media/stagefright/foundation/ALooper.h> namespace android { -static int64_t getNowUs() { - struct timeval tv; - gettimeofday(&tv, NULL); - - return (int64_t)tv.tv_usec + tv.tv_sec * 1000000ll; -} - ThrottledSource::ThrottledSource( const sp<DataSource> &source, int32_t bandwidthLimitBytesPerSecond) @@ -52,7 +46,7 @@ ssize_t ThrottledSource::readAt(off64_t offset, void *data, size_t size) { mTotalTransferred += n; - int64_t nowUs = getNowUs(); + int64_t nowUs = ALooper::GetNowUs(); if (mStartTimeUs < 0) { mStartTimeUs = nowUs; |