diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-03 18:47:44 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-03 18:50:43 +0300 |
commit | 888852055c1b203f5a89c7e229f87f412a6624da (patch) | |
tree | bc0a0752ec236eae297e19ea30cf00dee9672aa1 /source/blender/blenkernel/intern/sound.c | |
parent | 712fe561d58c78c2f9ecda2f07d4d45d36a384bf (diff) |
Sound: Fix for being unable to jump to a frame during playback with A/V sync
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 9e5fb3dac63..04e34331826 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -1213,6 +1213,19 @@ char **BKE_sound_get_device_names(void) #endif /* WITH_AUDASPACE */ +void BKE_sound_update_and_seek(Main *bmain, Depsgraph *depsgraph) +{ + Scene *scene_orig = DEG_get_input_scene(depsgraph); + Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); + /* NOTE: We don't do copy-on-write or anything like that here because we need to know scene's + * flags like "scrubbing" in the BKE_sound_seek_scene(). So we simply update frame to which + * seek needs to happen. + * + * TODO(sergey): Might change API so the frame is passes explicitly. */ + scene_eval->r.cfra = scene_orig->r.cfra; + BKE_sound_seek_scene(bmain, scene_eval); +} + void BKE_sound_reset_scene_runtime(Scene *scene) { scene->sound_scene = NULL; |