Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-01-01 21:23:12 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-01-01 21:27:17 +0400
commit9a1585a5331ec4dd3fcf7d024548820098181601 (patch)
tree81497353b88830ced2a139f66df5c6cfefee84e4 /source/blender/editors/space_clip
parent2c7b095f2bb4ad66dcff73b7eb14d4dc2266842e (diff)
Code cleanup: use bool flag for direction in clip prefetch
That was nothing really wrong with the old short used for direction, but that became kinda annoying because of compiler idiocy which considered direction might have been zero. Using explicit dual-state flag is more clear anyway.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_editor.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 0e1a2f98d40..20e69fce848 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -603,7 +603,10 @@ typedef struct PrefetchQueue {
int initial_frame, current_frame, start_frame, end_frame;
short render_size, render_flag;
- short direction;
+ /* If true prefecthing goes forward in time,
+ * othwewise it goes backwards in time (starting from current frame).
+ */
+ bool forward;
SpinLock spin;
@@ -707,17 +710,17 @@ static unsigned char *prefetch_thread_next_frame(PrefetchQueue *queue, MovieClip
{
int current_frame;
- if (queue->direction > 0) {
+ if (queue->forward) {
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;
+ queue->forward = false;
}
}
- if (queue->direction < 0) {
+ if (!queue->forward) {
current_frame = prefetch_find_uncached_frame(clip, queue->current_frame - 1, queue->start_frame,
queue->render_size, queue->render_flag, -1);
}
@@ -732,7 +735,7 @@ static unsigned char *prefetch_thread_next_frame(PrefetchQueue *queue, MovieClip
queue->current_frame = current_frame;
- if (queue->direction > 0) {
+ if (queue->forward) {
frames_processed = queue->current_frame - queue->initial_frame;
}
else {
@@ -808,7 +811,7 @@ static void start_prefetch_threads(MovieClip *clip, int start_frame, int current
queue.end_frame = end_frame;
queue.render_size = render_size;
queue.render_flag = render_flag;
- queue.direction = 1;
+ queue.forward = 1;
queue.stop = stop;
queue.do_update = do_update;