diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-15 20:20:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-15 20:20:06 +0300 |
commit | 76f50cd17a019fa226e6cf697abdae40bd625905 (patch) | |
tree | efae0504b93b2fc3cf5cbe8998d431526f36508d | |
parent | f51b583ea0379d7cded854b288a7ca95bcdfa46f (diff) |
Fix for clip proxies builder reloading original footage frames
This isn't needed if the source is the image sequence.
-rw-r--r-- | source/blender/blenkernel/BKE_movieclip.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 9 |
3 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h index 341105cfdf7..a4aa58e22f1 100644 --- a/source/blender/blenkernel/BKE_movieclip.h +++ b/source/blender/blenkernel/BKE_movieclip.h @@ -46,6 +46,7 @@ void BKE_movieclip_unlink(struct Main *bmain, struct MovieClip *clip); struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name); void BKE_movieclip_reload(struct MovieClip *clip); void BKE_movieclip_clear_cache(struct MovieClip *clip); +void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip); struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user); struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struct MovieClipUser *user, int postprocess_flag); diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index f62855efe75..0e9a7ce45cf 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -525,6 +525,15 @@ static bool put_imbuf_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, i } } +static bool moviecache_check_free_proxy(ImBuf *UNUSED(ibuf), + void *userkey, + void *UNUSED(userdata)) +{ + MovieClipImBufCacheKey *key = (MovieClipImBufCacheKey *)userkey; + + return !(key->proxy == IMB_PROXY_NONE && key->render_flag == 0); +} + /*********************** common functions *************************/ /* only image block itself */ @@ -1167,6 +1176,15 @@ void BKE_movieclip_clear_cache(MovieClip *clip) free_buffers(clip); } +void BKE_movieclip_clear_proxy_cache(MovieClip *clip) +{ + if (clip->cache && clip->cache->moviecache) { + IMB_moviecache_cleanup(clip->cache->moviecache, + moviecache_check_free_proxy, + NULL); + } +} + void BKE_movieclip_reload(MovieClip *clip) { /* clear cache */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 787a7fca273..9f9ac66de60 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1307,7 +1307,14 @@ static void proxy_endjob(void *pjv) if (pj->index_context) IMB_anim_index_rebuild_finish(pj->index_context, pj->stop); - BKE_movieclip_reload(pj->clip); + if (pj->clip->source == MCLIP_SRC_MOVIE) { + /* Timecode might have changed, so do a full reload to deal with this. */ + BKE_movieclip_reload(pj->clip); + } + else { + /* For image sequences we'll preserve original cache. */ + BKE_movieclip_clear_proxy_cache(pj->clip); + } WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, pj->clip); } |