diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-12 18:47:04 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-12 18:47:04 +0400 |
commit | d06bc3408842f2b9afa0a0dde755fe9b3a390695 (patch) | |
tree | 53fefaf672f5fcda53fbe2f835ae8b96ae9b2737 /source/blender/editors/space_clip/clip_editor.c | |
parent | d7983e3638896e5742fcf1bafe49c49a6b0aa08f (diff) |
Fix for prefetch not working correct if last frame was loaded
Diffstat (limited to 'source/blender/editors/space_clip/clip_editor.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 0d64a3ce594..f5db34d87d7 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -710,8 +710,14 @@ static unsigned char *prefetch_thread_next_frame(PrefetchQueue *queue, MovieClip if (queue->direction > 0) { current_frame = prefetch_find_uncached_frame(clip, queue->current_frame + 1, queue->end_frame, queue->render_size, queue->render_flag, 1); + /* switch direction if read frames from current up to scene end frames */ + if (current_frame >= queue->end_frame) { + queue->current_frame = queue->initial_frame; + queue->direction = -1; + } } - else { + + if (queue->direction < 0) { current_frame = prefetch_find_uncached_frame(clip, queue->current_frame - 1, queue->start_frame, queue->render_size, queue->render_flag, -1); } @@ -736,12 +742,6 @@ static unsigned char *prefetch_thread_next_frame(PrefetchQueue *queue, MovieClip *queue->do_update = 1; *queue->progress = (float)frames_processed / (queue->end_frame - queue->start_frame); - - /* switch direction if read frames from current up to scene end frames */ - if (current_frame == queue->end_frame) { - queue->current_frame = queue->initial_frame; - queue->direction = -1; - } } } BLI_spin_unlock(&queue->spin); |