From 1c8bc7bb999a7b7b02d1e99f21610cfca67433bb Mon Sep 17 00:00:00 2001 From: James Dong Date: Tue, 15 Jun 2010 18:14:03 -0700 Subject: [PATCH] When filling the cache, we always time out waiting for a condition that won't occur. We are actually improving the power consumption for streaming applications like Pandora. Change-Id: Id32bacbc962e8c69c056599479b308d6a07b7a20 --- media/libstagefright/Prefetcher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/libstagefright/Prefetcher.cpp b/media/libstagefright/Prefetcher.cpp index b6ed56b2753c5..650a9f96f1925 100644 --- a/media/libstagefright/Prefetcher.cpp +++ b/media/libstagefright/Prefetcher.cpp @@ -148,8 +148,10 @@ void Prefetcher::threadFunc() { if (mDone) { break; } + mCondition.waitRelative( - mLock, fillingCache ? 10000000ll : 1000000000ll); + mLock, fillingCache ? 1ll : 1000000000ll); + ssize_t minIndex = -1; for (size_t i = 0; i < mSources.size(); ++i) {