diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-01-27 13:01:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-01-27 13:01:41 +0300 |
commit | 4aa286d788d88d0cd59d80e5e5d5eed947b3206d (patch) | |
tree | 63769d71514367d2d975fdcc0efc6824e7cdf46c /source/blender/editors/space_sequencer | |
parent | 1bc6ae8529bfe90b3b003ec877775b7b4c542e24 (diff) |
Sequencer: Fix crash when trying to change filepath of Sound strip
It was not implemented and fallback RNA-based approach was not
correct since there's no filepath property of sound strip.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index d65cce1ad9c..9d96226027a 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -44,6 +44,7 @@ #include "BLT_translation.h" #include "DNA_scene_types.h" +#include "DNA_sound_types.h" #include "BKE_context.h" #include "BKE_global.h" @@ -3774,6 +3775,16 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) /* important else we don't get the imbuf cache flushed */ BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); } + else if (ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) { + bSound *sound = seq->sound; + if (sound == NULL) { + return OPERATOR_CANCELLED; + } + char filepath[FILE_MAX]; + RNA_string_get(op->ptr, "filepath", filepath); + BLI_strncpy(sound->name, filepath, sizeof(sound->name)); + BKE_sound_load(bmain, sound); + } else { /* lame, set rna filepath */ PointerRNA seq_ptr; |