This argument was used to prevent infinite loop in lookups between disk
and RAM cache.
Code was refactored, so this can be handled internally in cache.
Differential D9955
VSE: Remove skip_disk_cache argument Authored by Richard Antalik (ISS) on Dec 30 2020, 1:53 AM.
Details This argument was used to prevent infinite loop in lookups between disk Code was refactored, so this can be handled internally in cache.
Diff Detail
Event TimelineComment Actions Nice patch, I really like it when such a boolean "pass-me-around-everywhere" parameter can be removed. I've added some comments, and added @Sergey Sharybin (sergey) as reviewer as he's the module owner.
Comment Actions The bool was used to prevent endless loop since seq_cache_get would call seq_cache_put with bool to skip disk cache, because otherwise it would call seq_cache_get to check disk cache to prevent reinserting image that would call seq_cache_put again and so on. So if sequencer doesn't freeze, that means this works. Here is setup for usual test case and few methods how to check if things are working as they should: Setup: Test without any tools or possibility to change code: You can also inspect disk cache folder to see if files are created if something goes wrong. /* <cache type>-<resolution X>x<resolution Y>-<rendersize>%(<view_id>)-<frame no>.dcf */ #define DCACHE_FNAME_FORMAT "%d-%dx%d-%d%%(%d)-%d.dcf" Though there are things that I may need to clarify, for example you may wonder, why the red line (raw images) is not there on replay - This is because if final image is found, there is no need to read any more images Test with debug prints: diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c index f6795b15f7c..e7f747f3128 100644 --- a/source/blender/sequencer/intern/image_cache.c +++ b/source/blender/sequencer/intern/image_cache.c @@ -1365,9 +1365,12 @@ struct ImBuf *seq_cache_get(const SeqRenderData *context, BLI_mutex_unlock(&cache->disk_cache->read_write_mutex); if (ibuf == NULL) { + printf("image not found in disk cache\n"); return NULL; } + printf("frame from disk cache read successfully\n"); + /* Store read image in RAM. Only recycle item for final type. */ if (key.type != SEQ_CACHE_STORE_FINAL_OUT || seq_cache_recycle_item(scene)) { SeqCacheKey *new_key = seq_cache_allocate_key(cache, context, seq, timeline_frame, type); I should have probably added more info there such as what type is being read vs what is requested, but key for cache items is relatively big - there is lot of data so it depends what you are looking for exactly If none of above would provide meaningful insight, I would step in debugger and look at variables to see what's going on. Comment Actions Thanks for the test instructions, it seems to work well. I'll defer to @Sergey Sharybin (sergey) for the final accept as module owner. | ||||||||||||||||||||||||