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 | fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b (patch) | |
tree | 36a07a0e8484abeb2d8ec882833c6aef8aa7f231 /media/libstagefright/ThrottledSource.cpp | |
parent | 90689fda75c343ab9328ced63e58f45eabaa33cc (diff) | |
download | frameworks_av-fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b.zip frameworks_av-fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b.tar.gz frameworks_av-fa0e033ab5a0ab5d96e90c9f6d4d53bedc74514b.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; |