diff --git a/aegisub/src/video_provider_cache.cpp b/aegisub/src/video_provider_cache.cpp index 6c018af43..6778ed597 100644 --- a/aegisub/src/video_provider_cache.cpp +++ b/aegisub/src/video_provider_cache.cpp @@ -49,7 +49,10 @@ VideoProviderCache::VideoProviderCache(VideoProvider *parent) { master = parent; cacheMax = 0; - parent->WantsCaching() ? SetCacheMax(1) : SetCacheMax(0); + if (parent->WantsCaching()) + cacheMax = Options.AsInt(_T("Video cache size")) << 20; // convert MB to bytes + else + cacheMax = 0; } @@ -89,17 +92,6 @@ const AegiVideoFrame VideoProviderCache::GetFrame(int n) { return *srcFrame; } -/// @brief Set maximum cache size -/// @param n -/// -void VideoProviderCache::SetCacheMax(int n) { - if (n <= 0) - cacheMax = 0; - else - cacheMax = Options.AsInt(_T("Video cache size")) << 20; // convert MB to bytes -} - - /// @brief Add to cache /// @param n diff --git a/aegisub/src/video_provider_cache.h b/aegisub/src/video_provider_cache.h index 222f86889..c73faf307 100644 --- a/aegisub/src/video_provider_cache.h +++ b/aegisub/src/video_provider_cache.h @@ -88,7 +88,6 @@ private: protected: // Cache functions - void SetCacheMax(int n_frames); unsigned GetCurCacheSize(); void ClearCache();