From b90c3e14988c2180fd5b8028fec74527501a4deb Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sat, 5 Mar 2022 22:35:17 -0500 Subject: Ensure defaults are initialised --- src/spatial.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/spatial.c b/src/spatial.c index 7d71e37..ce3b64e 100644 --- a/src/spatial.c +++ b/src/spatial.c @@ -337,7 +337,7 @@ xas_spatial_scene *xas_spatial_scene_new(xas_audio_format format, scene->speaker_l = speaker_l; scene->speaker_r = speaker_r; scene->radius = XAS_SPATIAL_DEFAULT_RADIUS; - scene->speed = XAS_SPATIAL_DEFAULT_SPEED; + scene->speed = XAS_SPATIAL_DEFAULT_MEDIUM_SPEED; if (buffer_realloc(scene, NULL) < 0) { goto error_buffer_realloc; @@ -418,13 +418,17 @@ xas_spatial_object *xas_spatial_scene_add_object(xas_spatial_scene *scene, goto error_malloc_object; } - object->point = point; - object->source = source; - object->ctx = ctx; - object->flags = XAS_SPATIAL_OBJECT_NONE; - object->next = NULL; - object->delta_l = 0; - object->delta_r = 0; + object->point = point; + object->source = source; + object->ctx = ctx; + object->flags = XAS_SPATIAL_OBJECT_NONE; + object->heading.x = 0; + object->heading.y = 0; + object->heading.z = 0; + object->speed = XAS_SPATIAL_DEFAULT_OBJECT_SPEED; + object->next = NULL; + object->delta_l = 0; + object->delta_r = 0; object_position(scene, object, point); -- cgit v1.2.3