[vlc-devel] [PATCH 5/8] alsa pulse: force the Ambisonics to binaural conversion of the input (incomplete commit)

Adrien Maglo magsoft at videolan.org
Fri Feb 24 16:14:59 CET 2017


---
 modules/audio_output/alsa.c  | 8 ++++++++
 modules/audio_output/pulse.c | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 580ebb0..216d046 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -460,6 +460,14 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         goto error;
     }
 
+    /* Force Ambisonics to binaural conversion */
+    if (fmt->channel_type == AMBISONICS_CHANNELS)
+    {
+        fmt->channel_type = PHYSICAL_CHANNELS;
+        fmt->i_physical_channels = AOUT_CHANS_STEREO;
+        fmt->i_channels = 2;
+    }
+
     /* Set channels count */
     unsigned channels;
     if (!spdif)
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 38a0d66..cd796ec 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -757,6 +757,14 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
             break;
     }
 
+    /* Force Ambisonics to binaural conversion */
+    if (fmt->channel_type == AMBISONICS_CHANNELS)
+    {
+        fmt->channel_type = PHYSICAL_CHANNELS;
+        fmt->i_physical_channels = AOUT_CHANS_STEREO;
+        fmt->i_channels = 2;
+    }
+
     ss.rate = fmt->i_rate;
     ss.channels = fmt->i_channels;
     if (!pa_sample_spec_valid(&ss)) {
-- 
2.9.3



More information about the vlc-devel mailing list