[vlc-devel] [PATCH 05/18] spatialaudio: use vlc_viewpoint_to_euler
Alexandre Janniaux
ajanni at videolabs.io
Wed Mar 31 09:25:37 UTC 2021
From: Alexandre Janniaux <alexandre.janniaux at gmail.com>
---
modules/audio_filter/channel_mixer/spatialaudio.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp b/modules/audio_filter/channel_mixer/spatialaudio.cpp
index c8cda9175d..2bb4c0088f 100644
--- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
+++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
@@ -279,10 +279,13 @@ static void ChangeViewpoint( filter_t *p_filter, const vlc_viewpoint_t *p_vp)
{
filter_spatialaudio *p_sys = reinterpret_cast<filter_spatialaudio *>(p_filter->p_sys);
+ float yaw, pitch, roll;
+ vlc_viewpoint_to_euler(p_vp, &yaw, &pitch, &roll);
+
#define RAD(d) ((float) ((d) * M_PI / 180.f))
- p_sys->f_teta = -RAD(p_vp->yaw);
- p_sys->f_phi = RAD(p_vp->pitch);
- p_sys->f_roll = RAD(p_vp->roll);
+ p_sys->f_teta = -RAD(yaw);
+ p_sys->f_phi = RAD(pitch);
+ p_sys->f_roll = RAD(roll);
if (p_vp->fov >= FIELD_OF_VIEW_DEGREES_DEFAULT)
p_sys->f_zoom = 0.f; // no unzoom as it does not really make sense.
--
2.31.0
More information about the vlc-devel
mailing list