From d06bc3408842f2b9afa0a0dde755fe9b3a390695 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 12 Oct 2013 14:47:04 +0000 Subject: Fix for prefetch not working correct if last frame was loaded --- source/blender/editors/space_clip/clip_editor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_clip/clip_editor.c') 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); -- cgit v1.2.3