diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-07 12:30:00 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-07 12:50:38 +0300 |
commit | 2b9965122e132a2c25652ebf62d6353183f0f644 (patch) | |
tree | 776af5327831e6e680e7e911e5ee16114a665740 /source/blender/blenkernel/intern/scene.c | |
parent | 90a9ff44083e29b4a9f557a6e039099a7115f5db (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 72 |
1 files changed, 11 insertions, 61 deletions
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); -} |