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

Commit 6c90884d authored by Bryan Mawhinney's avatar Bryan Mawhinney Committed by Android (Google) Code Review
Browse files

Merge "Make sure seek triggers a reconnect if needed."

parents 04eaf3e5 40a4e144
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -370,6 +370,7 @@ void NuCachedSource2::onFetch() {
                    && (mSource->flags() & DataSource::kIsHTTPBasedSource)) {
                ALOGV("Disconnecting at high watermark");
                static_cast<HTTPBase *>(mSource.get())->disconnect();
                mFinalStatus = -EAGAIN;
            }
        }
    } else {
@@ -549,7 +550,7 @@ ssize_t NuCachedSource2::readInternal(off64_t offset, void *data, size_t size) {

    size_t delta = offset - mCacheOffset;

    if (mFinalStatus != OK) {
    if (mFinalStatus != OK && mNumRetriesLeft == 0) {
        if (delta >= mCache->totalSize()) {
            return mFinalStatus;
        }
@@ -591,7 +592,7 @@ status_t NuCachedSource2::seekInternal_l(off64_t offset) {
    size_t totalSize = mCache->totalSize();
    CHECK_EQ(mCache->releaseFromStart(totalSize), totalSize);

    mFinalStatus = OK;
    mNumRetriesLeft = kMaxNumRetries;
    mFetching = true;

    return OK;