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

Commit a3fafcb4 authored by Jeff Tinker's avatar Jeff Tinker
Browse files

[WVDRM] Fix for stuttering on low bandwidth

Reintroduces the play/pause rebuffering logic we eliminated
in JB zero day to fix double spins and slow startup - but
activates that logic only based on a comparison of the
current bandwidth measurement and the lowest bitrate track
in the movie.

Needs to be submitted with related changes in /vendor/widevine

bug: 7230071
Change-Id: If4f5ecda36c4858ce8bf5c4abb722f90a329ecdb
parent 23f74017
Loading
Loading
Loading
Loading
+7 −11
Original line number Original line Diff line number Diff line
@@ -755,22 +755,18 @@ void AwesomePlayer::onBufferingUpdate() {
        if ((mFlags & PLAYING) && !eos
        if ((mFlags & PLAYING) && !eos
                && (cachedDurationUs < kLowWaterMarkUs)) {
                && (cachedDurationUs < kLowWaterMarkUs)) {
            modifyFlags(CACHE_UNDERRUN, SET);
            modifyFlags(CACHE_UNDERRUN, SET);
            if (mWVMExtractor == NULL) {
            ALOGI("cache is running low (%.2f secs) , pausing.",
            ALOGI("cache is running low (%.2f secs) , pausing.",
                  cachedDurationUs / 1E6);
                  cachedDurationUs / 1E6);
            pause_l();
            pause_l();
            ensureCacheIsFetching_l();
            ensureCacheIsFetching_l();
            }
            sendCacheStats();
            sendCacheStats();
            notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
            notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
        } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
        } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
            if (mFlags & CACHE_UNDERRUN) {
            if (mFlags & CACHE_UNDERRUN) {
                modifyFlags(CACHE_UNDERRUN, CLEAR);
                modifyFlags(CACHE_UNDERRUN, CLEAR);
                if (mWVMExtractor == NULL) {
                ALOGI("cache has filled up (%.2f secs), resuming.",
                ALOGI("cache has filled up (%.2f secs), resuming.",
                      cachedDurationUs / 1E6);
                      cachedDurationUs / 1E6);
                play_l();
                play_l();
                }
            } else if (mFlags & PREPARING) {
            } else if (mFlags & PREPARING) {
                ALOGV("cache has filled up (%.2f secs), prepare is done",
                ALOGV("cache has filled up (%.2f secs), prepare is done",
                     cachedDurationUs / 1E6);
                     cachedDurationUs / 1E6);