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>2019-07-08 16:57:33 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-08 16:57:33 +0300
commit9cb1810551a257043f1f6db7e320b690ff4391f4 (patch)
tree86dd06e5956a7894a9a9d7677e232c2d83b370f1 /source/blender/makesrna/intern/rna_sound.c
parent8066784ac232e4c527a77d9cc7b7328e8407e21b (diff)
Fix T66431: SE - Audio Caching crash
Moved the caching code from direct calls in DNA to dependency graph. In fact, not much was needed to be done apart form removing the direct cache updates. The rest seemed to work fine. Possible to avoid full sound file re-load, but doesn't seem this is causing any issues.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sound.c')
-rw-r--r--source/blender/makesrna/intern/rna_sound.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index e4b120261c6..8402c4a8705 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -40,26 +40,10 @@ static void rna_Sound_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
DEG_id_tag_update(&sound->id, ID_RECALC_AUDIO);
}
-static bool rna_Sound_caching_get(PointerRNA *ptr)
+static void rna_Sound_caching_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- bSound *sound = (bSound *)(ptr->data);
- return (sound->flags & SOUND_FLAGS_CACHING) != 0;
-}
-
-static void rna_Sound_caching_set(PointerRNA *ptr, const bool value)
-{
- bSound *sound = (bSound *)(ptr->data);
- if (value) {
- BKE_sound_cache(sound);
- }
- else {
- BKE_sound_delete_cache(sound);
- }
-}
-
-static void rna_Sound_caching_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
-{
- BKE_sequencer_update_sound(scene, (bSound *)(ptr->data));
+ rna_Sound_update(bmain, scene, ptr);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
}
#else
@@ -87,7 +71,7 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Packed File", "");
prop = RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set");
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_CACHING);
RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM");
RNA_def_property_update(prop, 0, "rna_Sound_caching_update");