summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ThrottledSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/ThrottledSource.cpp')
-rw-r--r--media/libstagefright/ThrottledSource.cpp10
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;