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:
authorAntony Riakiotakis <kalast@gmail.com>2015-01-30 18:00:30 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-01-30 18:00:30 +0300
commitb58b182753e50aa10a1e5c7d152d5787aae433e0 (patch)
treec51a8c3c13691f684b2c823f021a5518b2959abd /source/blender/editors/space_sequencer
parentf7e8da6f5a5353c20a229e74d768384b5b1e5794 (diff)
Get rid of the file touch hack.
If user cancels, there's an issue with leftover files. Instead use a hash to record files that have akready been registered for generation and skip them if so. That should guarantee things will go smoothly and when a file exists it is assumed to be valid.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index a05cbfffb9f..9246667a427 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -37,6 +37,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLI_ghash.h"
#include "BLF_translation.h"
@@ -181,7 +182,8 @@ static void seq_proxy_build_job(const bContext *C)
struct SeqIndexBuildContext *context;
LinkData *link;
Sequence *seq;
-
+ GSet *file_list;
+
if (ed == NULL) {
return;
}
@@ -202,16 +204,19 @@ static void seq_proxy_build_job(const bContext *C)
WM_jobs_callbacks(wm_job, proxy_startjob, NULL, NULL, proxy_endjob);
}
+ file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
SEQP_BEGIN (ed, seq)
{
if ((seq->flag & SELECT)) {
- context = BKE_sequencer_proxy_rebuild_context(pj->main, pj->scene, seq);
+ context = BKE_sequencer_proxy_rebuild_context(pj->main, pj->scene, seq, file_list);
link = BLI_genericNodeN(context);
BLI_addtail(&pj->queue, link);
}
}
SEQ_END
+ BLI_gset_free(file_list, MEM_freeN);
+
if (!WM_jobs_is_running(wm_job)) {
G.is_break = false;
WM_jobs_start(CTX_wm_manager(C), wm_job);
@@ -3362,18 +3367,21 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq;
-
+ GSet *file_list;
+
if (ed == NULL) {
return OPERATOR_CANCELLED;
}
+ file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
+
SEQP_BEGIN(ed, seq)
{
if ((seq->flag & SELECT)) {
struct SeqIndexBuildContext *context;
short stop = 0, do_update;
float progress;
- context = BKE_sequencer_proxy_rebuild_context(bmain, scene, seq);
+ context = BKE_sequencer_proxy_rebuild_context(bmain, scene, seq, file_list);
BKE_sequencer_proxy_rebuild(context, &stop, &do_update, &progress);
BKE_sequencer_proxy_rebuild_finish(context, 0);
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
@@ -3381,6 +3389,8 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
}
SEQ_END
+ BLI_gset_free(file_list, MEM_freeN);
+
return OPERATOR_FINISHED;
}