[vlc-devel] [PATCH 07/12] aout: add aout_SetDefaultPhysicalChannels

Thomas Guillem thomas at gllm.fr
Fri Jul 7 15:39:54 CEST 2017


Set the default wg4 channel layout from a numbers of channels.
---
 include/vlc_aout.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index bbe7b4cbbe..458ed606f8 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -257,6 +257,15 @@ VLC_API char *aout_DeviceGet (audio_output_t *);
 VLC_API int aout_DeviceSet (audio_output_t *, const char *);
 VLC_API int aout_DevicesList (audio_output_t *, char ***, char ***);
 
+static inline void aout_SetDefaultPhysicalChannels(audio_sample_format_t *fmt)
+{
+    fmt->i_physical_channels = 0;
+    for (int i = 0; i < fmt->i_channels && i < AOUT_CHAN_MAX; ++i)
+        fmt->i_physical_channels |= pi_vlc_chan_order_wg4[i];
+    fmt->i_original_channels = fmt->i_physical_channels;
+    aout_FormatPrepare(fmt);
+}
+
 /**
  * Report change of configured audio volume to the core and UI.
  */
-- 
2.11.0



More information about the vlc-devel mailing list