]> git.sesse.net Git - ffmpeg/commitdiff
avdevice/pulse_audio_dec: set channel map
authorPaul B Mahol <onemda@gmail.com>
Wed, 12 Sep 2018 20:17:52 +0000 (22:17 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 14 Sep 2018 20:12:54 +0000 (22:12 +0200)
This fixes opening devices with >6 channels.

libavdevice/pulse_audio_dec.c

index 5977fb7e9e5f65914605283fb552767ab9fcdf94..042fe76d43572254d2381b143edc4f02832328f4 100644 (file)
@@ -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;
     }