Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcba3b90 authored by Jeff Tinker's avatar Jeff Tinker Committed by Android Git Automerger
Browse files

am c9bdf9b4: am dadc0ddb: Part of fix for double spins & faster startup

* commit 'c9bdf9b4':
  Part of fix for double spins & faster startup
parents 4f35be8b c9bdf9b4
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -753,19 +753,23 @@ void AwesomePlayer::onBufferingUpdate() {

        if ((mFlags & PLAYING) && !eos
                && (cachedDurationUs < kLowWaterMarkUs)) {
            modifyFlags(CACHE_UNDERRUN, SET);
            if (mWVMExtractor == NULL) {
                ALOGI("cache is running low (%.2f secs) , pausing.",
                      cachedDurationUs / 1E6);
            modifyFlags(CACHE_UNDERRUN, SET);
                pause_l();
                ensureCacheIsFetching_l();
                sendCacheStats();
            }
            notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
        } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
            if (mFlags & CACHE_UNDERRUN) {
                modifyFlags(CACHE_UNDERRUN, CLEAR);
                if (mWVMExtractor == NULL) {
                    ALOGI("cache has filled up (%.2f secs), resuming.",
                          cachedDurationUs / 1E6);
                modifyFlags(CACHE_UNDERRUN, CLEAR);
                    play_l();
                }
                notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
            } else if (mFlags & PREPARING) {
                ALOGV("cache has filled up (%.2f secs), prepare is done",