From aea2328906fc754c0d0cdea57c60d71522ae99a5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 5 Apr 2013 23:06:22 +0200 Subject: audio/out: switch to channel map This actually breaks audio for 5/6/8 channels. There's no reordering done yet. The actual reordering will be done inside of af_lavrresample and has to be made part of the format negotiation. --- audio/out/ao_portaudio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'audio/out/ao_portaudio.c') diff --git a/audio/out/ao_portaudio.c b/audio/out/ao_portaudio.c index b0744e8f8a..0141e4796d 100644 --- a/audio/out/ao_portaudio.c +++ b/audio/out/ao_portaudio.c @@ -273,9 +273,11 @@ static int init(struct ao *ao, char *params) if (pa_device == paNoDevice) goto error_exit; + mp_chmap_reorder_to_alsa(&ao->channels); + PaStreamParameters sp = { .device = pa_device, - .channelCount = ao->channels, + .channelCount = ao->channels.num, .suggestedLatency = Pa_GetDeviceInfo(pa_device)->defaultHighOutputLatency, }; @@ -298,7 +300,7 @@ static int init(struct ao *ao, char *params) ao->format = fmt->mp_format; sp.sampleFormat = fmt->pa_format; - priv->framelen = ao->channels * (af_fmt2bits(ao->format) / 8); + priv->framelen = ao->channels.num * (af_fmt2bits(ao->format) / 8); ao->bps = ao->samplerate * priv->framelen; if (!check_pa_ret(Pa_IsFormatSupported(NULL, &sp, ao->samplerate))) -- cgit v1.2.3