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>2020-07-30 16:36:11 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-07-31 12:45:40 +0300
commit1e7afea2bb236ad9281e0d4a3f0342a04cab65c9 (patch)
tree8ef7d0f5dc5aedbe3601487484fc1935a0978ff8 /source/blender/depsgraph
parent9ea6228b07efe4fcefdfb5de83a66308a73ce923 (diff)
Fix T78835: Ghosting audio after using undo
The root of the issue comes to the fact that sub-data pointers were used to match strips before/after copy-on-write. The undo system might re-use sub-data pointers after re-allocating them, making it so that, for example, pointer used by sound strip is later re-used by video strip. This fix takes an advantage of recently introduced per-sequence UUID and uses it to match sequences before/after copy-on-write.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc10
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h6
2 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc
index 2780938fe05..ba7d20c0ba8 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc
@@ -26,6 +26,8 @@
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
+#include "BLI_assert.h"
+
#include "BKE_sequencer.h"
#include "BKE_sound.h"
@@ -43,7 +45,9 @@ void SequencerBackup::init_from_scene(Scene *scene)
SequenceBackup sequence_backup(depsgraph);
sequence_backup.init_from_sequence(sequence);
if (!sequence_backup.isEmpty()) {
- sequences_backup.add(sequence->orig_sequence, sequence_backup);
+ const SessionUUID &session_uuid = sequence->runtime.session_uuid;
+ BLI_assert(BLI_session_uuid_is_generated(&session_uuid));
+ sequences_backup.add(session_uuid, sequence_backup);
}
}
SEQ_END;
@@ -53,7 +57,9 @@ void SequencerBackup::restore_to_scene(Scene *scene)
{
Sequence *sequence;
SEQ_BEGIN (scene->ed, sequence) {
- SequenceBackup *sequence_backup = sequences_backup.lookup_ptr(sequence->orig_sequence);
+ const SessionUUID &session_uuid = sequence->runtime.session_uuid;
+ BLI_assert(BLI_session_uuid_is_generated(&session_uuid));
+ SequenceBackup *sequence_backup = sequences_backup.lookup_ptr(session_uuid);
if (sequence_backup != nullptr) {
sequence_backup->restore_to_sequence(sequence);
}
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h
index 9fe38ec270c..4419238da32 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h
+++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h
@@ -23,6 +23,10 @@
#pragma once
+#include "DNA_session_uuid_types.h"
+
+#include "BLI_session_uuid.h"
+
#include "intern/depsgraph_type.h"
#include "intern/eval/deg_eval_runtime_backup_sequence.h"
@@ -43,7 +47,7 @@ class SequencerBackup {
const Depsgraph *depsgraph;
- Map<Sequence *, SequenceBackup> sequences_backup;
+ Map<SessionUUID, SequenceBackup> sequences_backup;
};
} // namespace deg