From patchwork Wed Sep 12 20:19:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 10307 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp5205825jap; Wed, 12 Sep 2018 13:20:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaKTWE53L8zOZoDOqr/97FTI9hV1HrS8PsZG2r/5PKvp5d2obWNBBds27Gv5jxnEWhjbC48 X-Received: by 2002:a1c:1802:: with SMTP id 2-v6mr2813029wmy.81.1536783609959; Wed, 12 Sep 2018 13:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536783609; cv=none; d=google.com; s=arc-20160816; b=ZBis5edw/ID62RL+QGqNhAEKpNHlVmy2rzLXbo26Tv3VNZQSUKt/JV9ekYCCusNgXj 4unsvZA4vZ7fMn8+/FpsfnYe5B+S8qGWiXt8+XWAUgsOFgYiDBXiA62wEXogHcRhoFCN z0EsSICm6ANnT1dc0CwRV3h7u9eegZg7L80vBnlmVYLcKnfiYvOkqqji3lXaQDp/0qXD Fn8yeHnBpBHiBejxYV+Hq3QBskwo5r1NLtUrCl8arehtC41Nef6nKdnWwSJXgNkl7LKW dYmbbbTCPHc9drePgKdeLSRz68shIwwUKYX8AhG1Keu2N5UmgDu794HXGzdVFywdTCJb vXrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=ZfrKORhjI4RU3YwJmUTV4Ii9IPBpuL4+RlvabcPghe4=; b=msgIwO2JS8UeZlJx1be+OXhjv2IuL9GRaHdrQv+6Gie8ag9hnMr4EyI/LqfUfuXEef 0XxjWuIjC1COb2mVCOVXTnlQZ+CJ1Q1ebRfvUYqfZV0NeikczZ1ZYoQYUShELOkjgrrq WWjMQjk5Q5uJcN0FLWyrsDeOe3pA1M2vcE73LWAvPNBp4ZMqgMYOsLOCQspcpYNo42we WFDg6QEzUgCBIqu5ZOQJCF9WzB+Y69AG7B1ITqCIQ3Xz65yZ4Ma5UFw/133pYbfIthkL ZxM1WmHyT9uzJB7cdmx4oc5qQEVohBvfRtXII/SJfYW6dpEl8y59Ga3pK0QuqJszx6lo uW+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=OpkWg6cH; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v123-v6si1814139wmf.105.2018.09.12.13.20.08; Wed, 12 Sep 2018 13:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=OpkWg6cH; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7276B68A501; Wed, 12 Sep 2018 23:19:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 32F2468A4CD for ; Wed, 12 Sep 2018 23:19:50 +0300 (EEST) Received: by mail-ed1-f67.google.com with SMTP id y20-v6so2831105edq.2 for ; Wed, 12 Sep 2018 13:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=8iFxAGxoirZlMhq432gSWSEo40PtYl+L3NGP2PolT6E=; b=OpkWg6cH/tbvpje6VQN2A4kwHvVAF0qurNUBgaJ2bMXKxTFIvYyFaCkf+GvWfTopyF f/S6N4iIIEPZIC7dI1o3WisW5F+a+M7ayTNvBzCLaZ5nFC5Eh4k1AkZHc//AMwTbeKqd G8J0WJ22l12u4mYIv3SIquotfd5tjBaIReYvNZ2Rkes6klIoIMsmVeTuZw2kzy8irALA KxapUNA3BHl2ufFsMfv6xcTjTyKApVmeNbx9YBQVD4aJGrHxrWRwCfjN6L6zc29iWK1P vyp36x05BGdKgkL3V1wWczkCk6McuEBKq5O3VMQfz4A8gk9m4pZXhxxIWr7ef5EiDFDA fDYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=8iFxAGxoirZlMhq432gSWSEo40PtYl+L3NGP2PolT6E=; b=j44hvQ/SAY7fzoK22sCmvH+Hsm5KedmRXmjVLIaGAMM7PosFALposk7bu9YRNZZVrP fx1NUcaBj6rI3FEfSZl/0W174ztscyW36FDLSnLRkOZK3bB0iWCNr4bsgEomQHP3ptQT NtMjQtG09YzKx6FbLTPjLby5cxb6NRAYAkYXYJX8p5h5/D/ox6v8SlMiTpYMUYFRS3T/ T5paF1Vrb2t6Hb136sxLAHacdA5W4VOPM0yN9fiOwVgUA1fAvK+rsZ7h628fgIR8wF// +Oehi/Lp6eovwcFqb60IMx/OZFDpRNTgALIkoAwHbrgnXmINuoZiU7NaU1ApKqEbgB9t u7wQ== X-Gm-Message-State: APzg51B4nph8Vb0Ves+HYmjos2Pm42ULp8+t4QcxEQc9yk95yQgTWpJv q1Ku7Fs9nPvmBgatKxVxYJW85MNk X-Received: by 2002:a50:af03:: with SMTP id g3-v6mr5260300edd.220.1536783599687; Wed, 12 Sep 2018 13:19:59 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id z56-v6sm2690646edz.54.2018.09.12.13.19.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 13:19:59 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Sep 2018 22:19:49 +0200 Message-Id: <20180912201949.30328-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] avdevice/pulse_audio_dec: set channel map X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This fixes opening devices with >6 channels. Signed-off-by: Paul B Mahol --- libavdevice/pulse_audio_dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }