[Bf-blender-cvs] [2b9965122e1] master: Sound: Revert all the recent changes to sound

Sergey Sharybin noreply at git.blender.org
Tue May 7 11:50:44 CEST 2019


Commit: 2b9965122e132a2c25652ebf62d6353183f0f644
Author: Sergey Sharybin
Date:   Tue May 7 11:30:00 2019 +0200
Branches: master
https://developer.blender.org/rB2b9965122e132a2c25652ebf62d6353183f0f644

Sound: Revert all the recent changes to sound

This happened to be a bigger rabbit hole to hell than it originally seemed,
and there are higher priority design tasks to be handled (at this point high
priority design task is more important than high priority bug fix).

After talking to Brecht the decision was made to revert to the known isolated
issue, which will allow everyone in the studio work same as prior to last
Friday.

The remaining bits will be worked on after all the design tasks are out of
the way.

This commit reverts:

4cdb4b9532c Fix T64161: Crashing using undo and multiple windows
064273a4ae7 Sound: Port more cases to be a part of dependency graph
2e582f8ab53 Sound: Fix access wrong dependency graph
5fc49d9c915 Sound: add stubs to build without audaspace
c68c81a870b Sound: Make sure spin lock is initialized for new sound datablocks
c02534469ac Sound: Delay creating sound scene handle for until is needed
9f681bea68f Fix T64144: Crash when displaying audio waveforms in VSE
2f79286453e Cleanup: unused vars
bed8ad6f95a Fix crash in background rendering after recent sound changes
773691310f9 Fix T64143: Crash when scrubbing in the graph editor
888852055c1 Sound: Fix for being unable to jump to a frame during playback with A/V sync
6ab7b384645 Sound: More fixes for access of original scene
35db1195455 Sound: Fix access original scene during playback
211c4fd2e9a Depsgraph: Make comment about evaluation more obvious
c5fe16e121e Sound: Make sound handles only be in evaluated datablocks
b4e1e0946bf Depsgraph: Preserve sound and audio pointers through copy-on-write
4eedf784b04 Depsgraph: Store original sequencer strip pointer
6990ef151c1 Sound: Move evaluation to dependency graph
d02da8de23b Sound: Delay opening handlers for until really needed
3369b828916 Depsgraph: Add scene audio component
e8f10d64757 Depsgraph: Tag sequencer for update on changes
6e4b7a6e4d9 Depsgraph: Initial work to cover sequencer
17447ac5a6b Depsgraph: Make sound ID part of the graph

===================================================================

M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/BKE_movieclip.h
M	source/blender/blenkernel/BKE_scene.h
M	source/blender/blenkernel/BKE_sound.h
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/blenkernel/intern/sound.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/depsgraph/DEG_depsgraph_query.h
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.h
M	source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.h
M	source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
M	source/blender/depsgraph/intern/builder/deg_builder_rna.cc
M	source/blender/depsgraph/intern/depsgraph_build.cc
M	source/blender/depsgraph/intern/depsgraph_query.cc
M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M	source/blender/depsgraph/intern/node/deg_node_operation.cc
M	source/blender/depsgraph/intern/node/deg_node_operation.h
M	source/blender/editors/animation/anim_ops.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/sound/CMakeLists.txt
M	source/blender/editors/sound/sound_ops.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_graph/graph_ops.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_sequencer/CMakeLists.txt
M	source/blender/editors/space_sequencer/sequencer_add.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/space_sequencer/sequencer_preview.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_sequence_types.h
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_sequencer.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_init_exit.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 9d8b9218a79..37c502b3b0c 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -113,7 +113,7 @@ void free_matcopybuf(void);
 void copy_matcopybuf(struct Main *bmain, struct Material *ma);
 void paste_matcopybuf(struct Main *bmain, struct Material *ma);
 
-/* Dependency graph evaluation. */
+/* Evaluation. */
 
 struct Depsgraph;
 
diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h
index 9425f396bc5..43ee284a201 100644
--- a/source/blender/blenkernel/BKE_movieclip.h
+++ b/source/blender/blenkernel/BKE_movieclip.h
@@ -116,8 +116,7 @@ bool BKE_movieclip_put_frame_if_possible(struct MovieClip *clip,
                                          struct MovieClipUser *user,
                                          struct ImBuf *ibuf);
 
-/* Dependency graph evaluation. */
-
+/* Evaluation. */
 void BKE_movieclip_eval_update(struct Depsgraph *depsgraph, struct MovieClip *clip);
 void BKE_movieclip_eval_selection_update(struct Depsgraph *depsgraph, struct MovieClip *clip);
 
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 3b5db883cf3..75ff5eace3c 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -240,14 +240,6 @@ void BKE_scene_cursor_quat_to_rot(struct View3DCursor *cursor,
                                   const float quat[4],
                                   bool use_compat);
 
-/* Dependency graph evaluation. */
-
-/* Evaluate parts of sequences which needs to be done as a part of a dependency graph evaluation.
- * This does NOT include actual rendering of the strips, but rather makes them up-to-date for
- * animation playback and makes them ready for the sequencer's rendering pipeline to render them.
- */
-void BKE_scene_eval_sequencer_sequences(struct Depsgraph *depsgraph, struct Scene *scene);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index 8d17380592e..91e23d35f0e 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -32,7 +32,6 @@
 struct Main;
 struct Sequence;
 struct bSound;
-struct Depsgraph;
 
 typedef struct SoundWaveform {
   int length;
@@ -72,17 +71,10 @@ void BKE_sound_cache(struct bSound *sound);
 
 void BKE_sound_delete_cache(struct bSound *sound);
 
-void BKE_sound_reset_runtime(struct bSound *sound);
 void BKE_sound_load(struct Main *main, struct bSound *sound);
-void BKE_sound_ensure_loaded(struct Main *bmain, struct bSound *sound);
 
 void BKE_sound_free(struct bSound *sound);
 
-/* Is used by sequencer to temporarily load audio to access information about channels and
- * duration. */
-void BKE_sound_load_audio(struct Main *main, struct bSound *sound);
-void BKE_sound_free_audio(struct bSound *sound);
-
 void BKE_sound_copy_data(struct Main *bmain,
                          struct bSound *sound_dst,
                          const struct bSound *sound_src,
@@ -94,9 +86,7 @@ void BKE_sound_make_local(struct Main *bmain, struct bSound *sound, const bool l
 AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
 #endif
 
-void BKE_sound_reset_scene_runtime(struct Scene *scene);
 void BKE_sound_create_scene(struct Scene *scene);
-void BKE_sound_ensure_scene(struct Scene *scene);
 
 void BKE_sound_destroy_scene(struct Scene *scene);
 
@@ -160,15 +150,4 @@ float BKE_sound_get_length(struct bSound *sound);
 
 char **BKE_sound_get_device_names(void);
 
-typedef void (*SoundJackSyncCallback)(struct Main *bmain, int mode, float time);
-
-void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback);
-void BKE_sound_jack_scene_update(struct Scene *scene, int mode, float time);
-
-/* Dependency graph evaluation. */
-
-struct Depsgraph;
-
-void BKE_sound_evaluate(struct Depsgraph *depsgraph, struct Main *bmain, struct bSound *sound);
-
 #endif /* __BKE_SOUND_H__ */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 7cd89705a1e..714261ce4ab 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -37,7 +37,6 @@
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_sequence_types.h"
-#include "DNA_sound_types.h"
 #include "DNA_space_types.h"
 #include "DNA_view3d_types.h"
 #include "DNA_windowmanager_types.h"
@@ -309,7 +308,8 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
                                                             flag_subdata);
   }
 
-  BKE_sound_reset_scene_runtime(sce_dst);
+  /* before scene copy */
+  BKE_sound_create_scene(sce_dst);
 
   /* Copy sequencer, this is local data! */
   if (sce_src->ed) {
@@ -399,7 +399,8 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
       sce_copy->r.ffcodecdata.properties = IDP_CopyProperty(sce->r.ffcodecdata.properties);
     }
 
-    BKE_sound_reset_scene_runtime(sce_copy);
+    /* before scene copy */
+    BKE_sound_create_scene(sce_copy);
 
     /* grease pencil */
     sce_copy->gpd = NULL;
@@ -779,7 +780,7 @@ void BKE_scene_init(Scene *sce)
   srv = sce->r.views.last;
   BLI_strncpy(srv->suffix, STEREO_RIGHT_SUFFIX, sizeof(srv->suffix));
 
-  BKE_sound_reset_scene_runtime(sce);
+  BKE_sound_create_scene(sce);
 
   /* color management */
   colorspace_name = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_SEQUENCER);
@@ -1507,30 +1508,6 @@ static void prepare_mesh_for_viewport_render(Main *bmain, const ViewLayer *view_
   }
 }
 
-static void scene_update_sound(Depsgraph *depsgraph, Main *bmain)
-{
-  Scene *scene = DEG_get_evaluated_scene(depsgraph);
-  const int recalc = scene->id.recalc;
-  BKE_sound_ensure_scene(scene);
-  if (recalc & ID_RECALC_AUDIO_SEEK) {
-    BKE_sound_seek_scene(bmain, scene);
-  }
-  if (recalc & ID_RECALC_AUDIO_FPS) {
-    BKE_sound_update_fps(scene);
-  }
-  if (recalc & ID_RECALC_AUDIO_VOLUME) {
-    BKE_sound_set_scene_volume(scene, scene->audio.volume);
-  }
-  if (recalc & ID_RECALC_AUDIO_MUTE) {
-    const bool is_mute = (scene->audio.flag & AUDIO_MUTE);
-    BKE_sound_mute_scene(scene, is_mute);
-  }
-  if (recalc & ID_RECALC_AUDIO_LISTENER) {
-    BKE_sound_update_scene_listener(scene);
-  }
-  BKE_sound_update_scene(bmain, scene);
-}
-
 /* TODO(sergey): This actually should become view_layer_graph or so.
  * Same applies to update_for_newframe.
  */
@@ -1559,9 +1536,10 @@ void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
    * by depgraph or manual, no layer check here, gets correct flushed.
    */
   DEG_evaluate_on_refresh(depsgraph);
-  /* Update sound system. */
-  scene_update_sound(depsgraph, bmain);
-  /* Notify python about depsgraph update. */
+  /* Update sound system animation (TODO, move to depsgraph). */
+  BKE_sound_update_scene(bmain, scene);
+
+  /* Notify python about depsgraph update */
   if (run_callbacks) {
     BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_POST);
   }
@@ -1596,8 +1574,8 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain)
    * by depgraph or manual, no layer check here, gets correct flushed.
    */
   DEG_evaluate_on_framechange(bmain, depsgraph, ctime);
-  /* Update sound system animation. */
-  scene_update_sound(depsgraph, bmain);
+  /* Update sound system animation (TODO, move to depsgraph). */
+  BKE_sound_update_scene(bmain, scene);
   /* Notify editors and python about recalc. */
   BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_FRAME_CHANGE_POST);
   /* Inform editors about possible changes. */
@@ -2409,31 +2387,3 @@ void BKE_scene_cursor_quat_to_rot(View3DCursor *cursor, const float quat[4], boo
 }
 
 /** \} */
-
-/* Dependency graph evaluation. */
-
-void BKE_scene_eval_sequencer_sequences(Depsgraph *depsgraph, Scene *scene)
-{
-  DEG_debug_print_eval(depsgraph, __func__, scene->id.name, scene);
-  if (scene->ed == NULL) {
-    return;
-  }
-  BKE_sound_ensure_scene(scene);
-  Sequence *seq;
-  SEQ_BEGIN (scene->ed, seq) {
-    if (seq->sound != NULL && seq->scene_sound == NULL) {
-      seq->scene_sound = BKE_sound_add_scene_sound_defaults(scene, seq);
-    }
-    if (seq->scene_sound) {
-      BKE_sound_set_scene_sound_volume(
-          seq->scene_sound, seq->volume, (seq->flag & SEQ_AUDIO_VOLUME_ANIMATED) != 0);
-      BKE_sound_set_scene_sound_pitch(
-          seq->scene_sound, seq->pitch, (seq->flag & SEQ_AUDIO_PITCH_ANIMATED) != 0);
-      BKE_sound_set_scene_sound_pan(
-          seq->scene_sound, seq->pan, (seq->flag & SEQ_AUDIO_PAN_ANIMATED) != 0);
-    }
-  }
-  SEQ_END;
-  BKE_sequencer_update_muting(scene->ed);
-  BKE_sequencer_update_sound_bounds_all(scene);
-}
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 98de4ab39fc..7f738ff4e4f 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -808,7 +808,10 @@ void BKE_sequence_calc_disp(Scene *scene, Sequence *seq)
     seq->handsize = (float)((seq->enddisp - seq->startdisp) / 25);
   }
 
-  if (seq->type == SEQ_TYPE_META) {
+  if (ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SCENE)) {
+    BKE_sequencer_update_sound_bounds(scene, seq);
+  }
+  else if (seq->type == SEQ_TYPE_META) {
     seq_update_sound_bounds_recursive(scene, seq);
   }
 }
@@ -5488,18 +5491,17 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad
   Strip *strip;
   StripElem *se;
 
+  AUD_SoundInfo info;
+
   sound = BKE_sound_new_file(bmain, seq_load->path); /* handles relative paths */
 
-  /* Load the original sound, so we can access number of channels and length information.
-   * We free the sound handle on the original bSound datablock before existing this function, it is
-   * to be allocated on an evaluated version after this. */
-  BKE_sound_load_audio(bmain, sound);
-  AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
   if (sound->playback_handle == NULL) {
     BKE_id_free(bmain, so

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list