summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AwesomePlayer.cpp
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2012-05-31 21:48:59 -0700
committerJeff Tinker <jtinker@google.com>2012-05-31 21:48:59 -0700
commitdadc0ddbfe309086801b479ddc91c55eeb2a9cbb (patch)
tree18baae93ed3d613c065c43267f9c47ac02a2325d /media/libstagefright/AwesomePlayer.cpp
parent27d33134130379cc91d936cdc742700311901a9d (diff)
downloadframeworks_av-dadc0ddbfe309086801b479ddc91c55eeb2a9cbb.zip
frameworks_av-dadc0ddbfe309086801b479ddc91c55eeb2a9cbb.tar.gz
frameworks_av-dadc0ddbfe309086801b479ddc91c55eeb2a9cbb.tar.bz2
Part of fix for double spins & faster startup
This change alters the way that the media player interacts with the Widevine adaptive streaming buffer logic. It eliminates the reliance on cached buffer duration to determine pause/play states and instead only generates buffering events when the widevine library is not producing data (i.e. when it is buffering). This eliminates unnecessary pause and rebuffer cycles, reducing startup time and the frequency and duration of spinners. Multi-repo commit, depends on related changes in vendor/widevine Change-Id: I387db2decd83841775a8351bddf5a6381fe4104f related-to-bug:6503294 related-to-bug:6463780
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 892da92..0749254 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -753,19 +753,23 @@ void AwesomePlayer::onBufferingUpdate() {
if ((mFlags & PLAYING) && !eos
&& (cachedDurationUs < kLowWaterMarkUs)) {
- ALOGI("cache is running low (%.2f secs) , pausing.",
- cachedDurationUs / 1E6);
modifyFlags(CACHE_UNDERRUN, SET);
- pause_l();
- ensureCacheIsFetching_l();
- sendCacheStats();
+ if (mWVMExtractor == NULL) {
+ ALOGI("cache is running low (%.2f secs) , pausing.",
+ cachedDurationUs / 1E6);
+ pause_l();
+ ensureCacheIsFetching_l();
+ sendCacheStats();
+ }
notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
} else if (eos || cachedDurationUs > kHighWaterMarkUs) {
if (mFlags & CACHE_UNDERRUN) {
- ALOGI("cache has filled up (%.2f secs), resuming.",
- cachedDurationUs / 1E6);
modifyFlags(CACHE_UNDERRUN, CLEAR);
- play_l();
+ if (mWVMExtractor == NULL) {
+ ALOGI("cache has filled up (%.2f secs), resuming.",
+ cachedDurationUs / 1E6);
+ play_l();
+ }
notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
} else if (mFlags & PREPARING) {
ALOGV("cache has filled up (%.2f secs), prepare is done",