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.
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
#include "BLT_translation.h"
|
#include "BLT_translation.h"
|
||||||
|
|
||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
|
#include "DNA_sound_types.h"
|
||||||
|
|
||||||
#include "BKE_context.h"
|
#include "BKE_context.h"
|
||||||
#include "BKE_global.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 */
|
/* important else we don't get the imbuf cache flushed */
|
||||||
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
|
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 {
|
else {
|
||||||
/* lame, set rna filepath */
|
/* lame, set rna filepath */
|
||||||
PointerRNA seq_ptr;
|
PointerRNA seq_ptr;
|
||||||
|
Reference in New Issue
Block a user