Previously, if we had disconnected at the high watermark,
the read immediately following a seek would fail, and would
not be retried, resulting in an error.
Change-Id: I45a53563fe17d6b54893815abc7750a7dfb0a124
&& (mSource->flags() & DataSource::kIsHTTPBasedSource)) {
ALOGV("Disconnecting at high watermark");
static_cast<HTTPBase *>(mSource.get())->disconnect();
+ mFinalStatus = -EAGAIN;
}
}
} else {
size_t delta = offset - mCacheOffset;
- if (mFinalStatus != OK) {
+ if (mFinalStatus != OK && mNumRetriesLeft == 0) {
if (delta >= mCache->totalSize()) {
return mFinalStatus;
}
size_t totalSize = mCache->totalSize();
CHECK_EQ(mCache->releaseFromStart(totalSize), totalSize);
- mFinalStatus = OK;
+ mNumRetriesLeft = kMaxNumRetries;
mFetching = true;
return OK;