diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-01 12:12:18 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-01 12:14:18 +0300 |
commit | 89946834a1708db91645aac4fb950b7588035d6d (patch) | |
tree | a087e25aa889c04506cbe80133f7fff75d89c80e /source/blender/blenkernel/intern/scene.c | |
parent | 65d770ffa36df9ad52ee1015ba031ad79db5422d (diff) |
Fix T66279: Strip sound keeps playing after toggling to Camera
Before this change using Sequencer input for the scene strip would
permanently enable sound playing back for that strip. Going back to
Camera would have been still playing sound from the strip, which is
rather misleading since rest of the nested sequencer is not used.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index d2d56569bff..a447b828bb1 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2445,6 +2445,21 @@ void BKE_scene_cursor_from_mat4(View3DCursor *cursor, const float mat[4][4], boo /* Dependency graph evaluation. */ +static void scene_sequencer_disable_sound_strips(Scene *scene) +{ + if (scene->sound_scene == NULL) { + return; + } + Sequence *seq; + SEQ_BEGIN (scene->ed, seq) { + if (seq->scene_sound != NULL) { + BKE_sound_remove_scene_sound(scene, seq->scene_sound); + seq->scene_sound = NULL; + } + } + SEQ_END; +} + void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene) { DEG_debug_print_eval(depsgraph, __func__, scene->id.name, scene); @@ -2474,6 +2489,9 @@ void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene) * then it is no longer needed to do such manual forced updates. */ if (seq->type == SEQ_TYPE_SCENE && seq->scene != NULL) { BKE_sound_set_scene_volume(seq->scene, seq->scene->audio.volume); + if ((seq->flag & SEQ_SCENE_STRIPS) == 0) { + scene_sequencer_disable_sound_strips(seq->scene); + } } if (seq->sound != NULL) { if (scene->id.recalc & ID_RECALC_AUDIO || seq->sound->id.recalc & ID_RECALC_AUDIO) { |