[vlc-devel] commit: Pulseaudio surround support (Danny Wood )
git version control
git at videolan.org
Wed Dec 3 15:48:24 CET 2008
vlc | branch: master | Danny Wood <danwood76 at gmail.com> | Wed Dec 3 16:47:33 2008 +0200| [35be7fb34b848b6de1108a32dbd1ecbe0212a45f] | committer: Rémi Denis-Courmont
Pulseaudio surround support
Signed-off-by: Rémi Denis-Courmont <rdenis at simphalempin.com>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=35be7fb34b848b6de1108a32dbd1ecbe0212a45f
---
modules/audio_output/pulse.c | 43 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index d1e5d50..4fd20d3 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -123,12 +123,43 @@ static int Open ( vlc_object_t *p_this )
PULSE_DEBUG( "Pulse start initialization");
- ss.rate = p_aout->output.output.i_rate;
- ss.channels = 2;
+ ss.channels = aout_FormatNbChannels( &p_aout->output.output ); /* Get the input stream channel count */
+
+ /* Setup the pulse audio stream based on the input stream count */
+ switch(ss.channels)
+ {
+ case 6:
+ p_aout->output.output.i_physical_channels
+ = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
+ | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
+ | AOUT_CHAN_LFE;
+ break;
+
+ case 4:
+ p_aout->output.output.i_physical_channels
+ = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
+ | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
+ break;
+
+ case 2:
+ p_aout->output.output.i_physical_channels
+ = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
+ break;
+
+ case 1:
+ p_aout->output.output.i_physical_channels = AOUT_CHAN_CENTER;
+ break;
+
+ default:
+ msg_Err(p_aout,"Invalid number of channels");
+ goto fail;
+ }
+ /* Add a quick command line info message */
+ msg_Info(p_aout, "No. of Audio Channels: %d", ss.channels);
+
+ ss.rate = p_aout->output.output.i_rate;
ss.format = PA_SAMPLE_S16LE;
- p_aout->output.output.i_physical_channels =
- AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
p_aout->output.output.i_format = AOUT_FMT_S16_NE;
if (!pa_sample_spec_valid(&ss)) {
@@ -148,8 +179,8 @@ static int Open ( vlc_object_t *p_this )
p_sys->buffer_size = a.minreq;
- pa_channel_map_init_stereo(&map);
-
+ /* Initialise the speaker map setup above */
+ pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_ALSA);
if (!(p_sys->mainloop = pa_threaded_mainloop_new())) {
msg_Err(p_aout, "Failed to allocate main loop");
More information about the vlc-devel
mailing list