[FFmpeg-devel] avdevice/pulse_audio_dec: set channel map

Submitted by Paul B Mahol on Sept. 12, 2018, 8:19 p.m.

Details

Message ID 20180912201949.30328-1-onemda@gmail.com
State Accepted
Commit 6a467d432f9228bec6f1cfeb2767f7e94c29f661
Headers show

Commit Message

Paul B Mahol Sept. 12, 2018, 8:19 p.m.
This fixes opening devices with >6 channels.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavdevice/pulse_audio_dec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Paul B Mahol Sept. 14, 2018, 1:24 p.m.
On 9/12/18, Paul B Mahol <onemda@gmail.com> wrote:
> This fixes opening devices with >6 channels.
>
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavdevice/pulse_audio_dec.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Will apply.

Patch hide | download patch | download mbox

diff --git a/libavdevice/pulse_audio_dec.c b/libavdevice/pulse_audio_dec.c
index 5977fb7e9e..042fe76d43 100644
--- a/libavdevice/pulse_audio_dec.c
+++ b/libavdevice/pulse_audio_dec.c
@@ -148,6 +148,9 @@  static av_cold int pulse_read_header(AVFormatContext *s)
                                 pd->channels };
 
     pa_buffer_attr attr = { -1 };
+    pa_channel_map cmap;
+
+    pa_channel_map_init_extend(&cmap, pd->channels, PA_CHANNEL_MAP_WAVEEX);
 
     st = avformat_new_stream(s, NULL);
 
@@ -202,7 +205,7 @@  static av_cold int pulse_read_header(AVFormatContext *s)
         pa_threaded_mainloop_wait(pd->mainloop);
     }
 
-    if (!(pd->stream = pa_stream_new(pd->context, pd->stream_name, &ss, NULL))) {
+    if (!(pd->stream = pa_stream_new(pd->context, pd->stream_name, &ss, &cmap))) {
         ret = AVERROR(pa_context_errno(pd->context));
         goto unlock_and_fail;
     }