Loaders: Depriorize disc streaming queue items.

We want the local items, if any, to load first.  This gives us icons, etc.
This commit is contained in:
Unknown W. Brackets 2017-12-09 17:07:42 -08:00
parent 2943bbdbfd
commit 8b665ae696
11 changed files with 31 additions and 0 deletions

View File

@ -289,6 +289,10 @@ void CachingFileLoader::StartReadAhead(s64 pos) {
th.detach();
}
bool CachingFileLoader::IsRemote() {
return backend_->IsRemote();
}
void CachingFileLoader::Cancel() {
backend_->Cancel();
}

View File

@ -28,6 +28,7 @@ public:
CachingFileLoader(FileLoader *backend);
~CachingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;

View File

@ -115,6 +115,10 @@ size_t DiskCachingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data,
return readSize;
}
bool DiskCachingFileLoader::IsRemote() {
return backend_->IsRemote();
}
void DiskCachingFileLoader::Cancel() {
backend_->Cancel();
}

View File

@ -32,6 +32,7 @@ public:
DiskCachingFileLoader(FileLoader *backend);
~DiskCachingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;

View File

@ -30,6 +30,9 @@ public:
HTTPFileLoader(const std::string &filename);
virtual ~HTTPFileLoader() override;
bool IsRemote() override {
return true;
}
virtual bool Exists() override;
virtual bool ExistsFast() override;
virtual bool IsDirectory() override;

View File

@ -270,3 +270,7 @@ u32 RamCachingFileLoader::NextAheadBlock() {
return 0xFFFFFFFF;
}
bool RamCachingFileLoader::IsRemote() {
return backend_->IsRemote();
}

View File

@ -28,6 +28,7 @@ public:
RamCachingFileLoader(FileLoader *backend);
~RamCachingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;

View File

@ -73,6 +73,10 @@ size_t RetryingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data, Fla
return readSize;
}
bool RetryingFileLoader::IsRemote() {
return backend_->IsRemote();
}
void RetryingFileLoader::Cancel() {
backend_->Cancel();
}

View File

@ -25,6 +25,7 @@ public:
RetryingFileLoader(FileLoader *backend);
~RetryingFileLoader() override;
bool IsRemote() override;
bool Exists() override;
bool ExistsFast() override;
bool IsDirectory() override;

View File

@ -66,6 +66,9 @@ public:
virtual ~FileLoader() {}
virtual bool IsRemote() {
return false;
}
virtual bool Exists() = 0;
virtual bool ExistsFast() {
return Exists();

View File

@ -650,6 +650,11 @@ handleELF:
}
float priority() override {
auto fl = info_->GetFileLoader();
if (fl && fl->IsRemote()) {
// Increase the value so remote info loads after non-remote.
return info_->lastAccessedTime + 1000.0f;
}
return info_->lastAccessedTime;
}