Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/image_cache.c
| Show First 20 Lines • Show All 711 Lines • ▼ Show 20 Lines | void seq_cache_thumbnail_cleanup(Scene *scene, rctf *view_area_safe) | ||||
| } | } | ||||
| GHashIterator gh_iter; | GHashIterator gh_iter; | ||||
| BLI_ghashIterator_init(&gh_iter, cache->hash); | BLI_ghashIterator_init(&gh_iter, cache->hash); | ||||
| while (!BLI_ghashIterator_done(&gh_iter)) { | while (!BLI_ghashIterator_done(&gh_iter)) { | ||||
| SeqCacheKey *key = BLI_ghashIterator_getKey(&gh_iter); | SeqCacheKey *key = BLI_ghashIterator_getKey(&gh_iter); | ||||
| BLI_ghashIterator_step(&gh_iter); | BLI_ghashIterator_step(&gh_iter); | ||||
| const int frame_index = key->timeline_frame - key->seq->startdisp; | |||||
| const int frame_step = SEQ_render_thumbnails_guaranteed_set_frame_step_get(key->seq); | const int frame_step = SEQ_render_thumbnails_guaranteed_set_frame_step_get(key->seq); | ||||
| const int relative_base_frame = round_fl_to_int((frame_index / (float)frame_step)) * | const int frame_index = key->seq->start - key->timeline_frame; | ||||
| frame_step; | const int steps = round_fl_to_int((frame_index + frame_step * 0.5f) / frame_step); | ||||
| const int nearest_guaranted_absolute_frame = relative_base_frame + key->seq->startdisp; | const int nearest_guaranted_absolute_frame = key->seq->start + steps * frame_step; | ||||
| if (nearest_guaranted_absolute_frame == key->timeline_frame) { | if (nearest_guaranted_absolute_frame == key->timeline_frame) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if ((key->type & SEQ_CACHE_STORE_THUMBNAIL) && | if ((key->type & SEQ_CACHE_STORE_THUMBNAIL) && | ||||
| (key->timeline_frame > view_area_safe->xmax || | (key->timeline_frame > view_area_safe->xmax || | ||||
| key->timeline_frame < view_area_safe->xmin || key->seq->machine > view_area_safe->ymax || | key->timeline_frame < view_area_safe->xmin || key->seq->machine > view_area_safe->ymax || | ||||
| ▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines | |||||