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-05-02 15:31:33 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-05-03 16:50:40 +0300
commitc5fe16e121eefe5dd02cc9f9ba572053c383ccfa (patch)
treeaa74a6fff290294220faf9c4a77aef4e17da250b /source/blender/makesdna/DNA_ID.h
parentb4e1e0946bf124f95e1d9fa1a6ffa1cbc143c7d6 (diff)
Sound: Make sound handles only be in evaluated datablocks
Quite straightforward change, which makes it so audio handles are only created inside of evaluated datablocks. Exception is adding sound strip to the sequencer, which needs an audio handle to query length and number of channels. This is done by temporarily loading sound file into an original datablock, and then tossing it away. There is an assert in sound.c which verifies that audio system is used from an evaluated domain, which should help porting all the cases which are likely missed by this commit. Some annoying parts: - `BKE_sound_update_scene()` is iterating over all bases, and does special ID tags to see whether sound has been handled or not already. This can not be done the old fashion now. Ideally, this will be done as a speaker datablock evaluation, but seems that would require a lock since audio API is not safe for threading. So this is not a desired way i'd say. Possible solution here would be to iterate over ID datablocks using dependency graph query API. - Frame jump needs to call `BKE_sound_seek_scene()` directly because there might be some flags assigned to the scene which could be clear after operator execution is over. Need to verify if that's the case though. This is a bit hairy code, so sticking to a safest and known to work approach for now. - Removed check for format when opening new sound file. Maybe we can have some utility function which queries channel and duration information, leaving the caller's code clean and tidy. Tested following cases: - Adding/removing/moving sequencer's sound strips. - Adding/moving speakers in viewport. - Rendering audio. Reviewers: brecht Differential Revision: https://developer.blender.org/D4779
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r--source/blender/makesdna/DNA_ID.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 42ee4e9a6c8..14b3d97cef4 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -448,9 +448,7 @@ typedef enum ID_Type {
/* No copy-on-write for these types.
* Keep in sync with check_datablocks_copy_on_writable and deg_copy_on_write_is_needed */
-/* TODO(sergey): Make Sound copyable. It is here only because the code for dependency graph is
- * being work in progress. */
-#define ID_TYPE_IS_COW(_id_type) (!ELEM(_id_type, ID_BR, ID_LS, ID_PAL, ID_IM, ID_SO))
+#define ID_TYPE_IS_COW(_id_type) (!ELEM(_id_type, ID_BR, ID_LS, ID_PAL, ID_IM))
#ifdef GS
# undef GS
@@ -608,10 +606,6 @@ typedef enum IDRecalcFlag {
* Use this tag with a scene ID which owns the sequences. */
ID_RECALC_SEQUENCER = (1 << 14),
- /* Frame changed in a way that caused audio jump.
- * Use this on a scene ID. */
- ID_RECALC_AUDIO_JUMP = (1 << 15),
-
/***************************************************************************
* Pseudonyms, to have more semantic meaning in the actual code without
* using too much low-level and implementation specific tags. */