made auto-deleting cache on close an option
Previously we had no disk management whatsoever, so we cleared the cache on every close just to prevent clogging up tester disk space. Now that we are implementing disk management, there are better things to do on close regarding disk cache. However, some users may still wish for the app to delete the cache on close, so it's provided as an option.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <QtMath>
|
||||
|
||||
#include "common/timecodefunctions.h"
|
||||
#include "render/diskmanager.h"
|
||||
#include "render/pixelservice.h"
|
||||
#include "videorenderworker.h"
|
||||
|
||||
@@ -181,6 +182,8 @@ const char *VideoRenderBackend::GetCachedFrame(const rational &time)
|
||||
auto in = OIIO::ImageInput::open(fn.toStdString());
|
||||
|
||||
if (in) {
|
||||
DiskManager::instance()->Accessed(frame_hash);
|
||||
|
||||
in->read_image(PixelService::GetPixelFormatInfo(params_.format()).oiio_desc, cache_frame_load_buffer_.data());
|
||||
|
||||
in->close();
|
||||
@@ -244,6 +247,11 @@ void VideoRenderBackend::ThreadCompletedDownload(NodeDependency dep, qint64 job_
|
||||
|
||||
SetFrameHash(dep, hash, job_time);
|
||||
|
||||
// Register frame with the disk manager
|
||||
if (operating_mode_ & VideoRenderWorker::kDownloadOnly) {
|
||||
DiskManager::instance()->CreatedFile(frame_cache()->CachePathName(hash), hash);
|
||||
}
|
||||
|
||||
QList<rational> hashes_with_time = frame_cache()->FramesWithHash(hash);
|
||||
|
||||
foreach (const rational& t, hashes_with_time) {
|
||||
|
||||
Reference in New Issue
Block a user