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:
authorJörg Müller <nexyon@gmail.com>2020-05-03 16:25:52 +0300
committerJörg Müller <nexyon@gmail.com>2020-05-03 16:30:35 +0300
commitfe891d581dfece13b42414ba1d8fec6063290a31 (patch)
treef637697a4b96c5a9522d61fc500eba64a623fa19 /source/blender/blenkernel/intern/sound.c
parent2b7d5caae8a1f00a137247af819529ed5e8d0200 (diff)
Audaspace: update from upstream
- Changing API for time values from float to double for better precision. - Fixing minor mistakes in the documentation. - Fixing minor unnecessary large memory allocation.
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 64fe396d6a3..5500918428f 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -751,12 +751,12 @@ static void sound_start_play_scene(Scene *scene)
}
}
-static float get_cur_time(Scene *scene)
+static double get_cur_time(Scene *scene)
{
/* We divide by the current framelen to take into account time remapping.
* Otherwise we will get the wrong starting time which will break A/V sync.
* See T74111 for further details. */
- return FRA2TIME((CFRA + SUBFRA) / scene->r.framelen);
+ return FRA2TIME((CFRA + SUBFRA) / (double)scene->r.framelen);
}
void BKE_sound_play_scene(Scene *scene)
@@ -764,7 +764,7 @@ void BKE_sound_play_scene(Scene *scene)
sound_verify_evaluated_id(&scene->id);
AUD_Status status;
- const float cur_time = get_cur_time(scene);
+ const double cur_time = get_cur_time(scene);
AUD_Device_lock(sound_device);
@@ -811,8 +811,8 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene)
bScreen *screen;
int animation_playing;
- const float one_frame = (float)(1.0 / FPS);
- const float cur_time = FRA2TIME(CFRA);
+ const double one_frame = 1.0 / FPS;
+ const double cur_time = FRA2TIME(CFRA);
AUD_Device_lock(sound_device);
@@ -869,7 +869,7 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene)
AUD_Device_unlock(sound_device);
}
-float BKE_sound_sync_scene(Scene *scene)
+double BKE_sound_sync_scene(Scene *scene)
{
sound_verify_evaluated_id(&scene->id);
@@ -1230,7 +1230,7 @@ void BKE_sound_stop_scene(Scene *UNUSED(scene))
void BKE_sound_seek_scene(Main *UNUSED(bmain), Scene *UNUSED(scene))
{
}
-float BKE_sound_sync_scene(Scene *UNUSED(scene))
+double BKE_sound_sync_scene(Scene *UNUSED(scene))
{
return NAN_FLT;
}
@@ -1341,7 +1341,7 @@ void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback)
#endif
}
-void BKE_sound_jack_scene_update(Scene *scene, int mode, float time)
+void BKE_sound_jack_scene_update(Scene *scene, int mode, double time)
{
sound_verify_evaluated_id(&scene->id);