From patchwork Tue Aug 31 12:42:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29915 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4888383iov; Tue, 31 Aug 2021 05:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7HKMjm0VV3Dql6j2A6foUpYjbL6Jxhze2b/Kf2/lw0BqRMKEwXuWetuNOmQLheZpDCb4t X-Received: by 2002:a17:906:8597:: with SMTP id v23mr23602721ejx.178.1630413800250; Tue, 31 Aug 2021 05:43:20 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g23si18160392edp.82.2021.08.31.05.43.18; Tue, 31 Aug 2021 05:43:20 -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=@outlook.com header.s=selector1 header.b=ZBfdlRYT; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A78B8689FB2; Tue, 31 Aug 2021 15:43:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2025.outbound.protection.outlook.com [40.92.89.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0656F6802F5 for ; Tue, 31 Aug 2021 15:43:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvVBOLWF2wxs0TMEE8mRmcoWD+vcb42XxNwCdbmq156MfbEFq22vO1jeSqWT07Y5ZFR85dIHf8TXbfHvh+of3zqqUp1BszO3+3JOE2IUKB6aNv8WtCmCIHYx3AhOQ5n8h2n/tGB8VKJ+3YCMcfGpxPhNZx303V9zlVACT9ouBmBNbRiK6el4gm4ud9F87VOQNUdAvgQw8QSh2KkUhYD9pxOn/WfOQQF3mZDBF2cFwDwhLmJ9R/KyufBQyy2kA0DUOw3rtubs4DysQfP3kQZlexGW6Yg+LXelfvXx7fVbK11xDir6tzrRAIS5NmofTvkKsiPZ2QxIUXcLs9JDKY9Hqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qxc+1U+HnXKIO2mnt0jFUhTdD64Ax578x/JVM6vQkeI=; b=ChaLUBhhN8bO1KVQ9is99L+cYNIvOtAkvxtYatCzhZp3wSfqmSibQWo2Dzj4QzIBdwXWGpl4RDBYxu97R8blad3eONDbQeJn8obyPupzoABy2Zz9/6t2QQkDRd+sjMZUjlNDD5Wd41WAzM3tGNhwX3Qs0AgnB/0fytaxQ1eIVopqf5/tezrLhJ03HlkbwVE1XZbURAOOOJHqS1vhOXpr/hOqsQFoCxVFqcpE7D5JZjIQ5EQGkq8IRS4LUmPzXnL66OtMmLV5pw0mCCcLFDwzM/SXQspwOPBL5e9nBlxlcf+qIfB9SqqjedFgTgNHWOsyPh8Aaa5SDpe2S5E1XatdTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qxc+1U+HnXKIO2mnt0jFUhTdD64Ax578x/JVM6vQkeI=; b=ZBfdlRYTg3JtODFf+gzLRmYmSDv9rErOAmofEMnhrtywzUhVJZYzcLM5M6930Ct15LTa+7TcixGNXWgGedtXBx+JvQRzgZ+1XksSRyh2WWjsrn+N9RjZ7LessWNnz7ozTrxRkMqOHVFvnVYRDiVvrPwNDSGW/EZaXVKqHoTUCSjEThSz1LWUf6QKrIguylIP9H6oEW9mF0YE7fV9aQhW6zQi7fFc3NtRdJ65KiB0is8EWZ73a6AfWjkjsd76W3LI/lFnJ7qeiWncPxaP3bO2G3YW+dh5fo9WmpSqFnsJ6KdY3U9tum+wzuU6NTjnDuNjX5AMF6WHWhSdyIFuLsy71w== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB6005.eurprd03.prod.outlook.com (2603:10a6:20b:e2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Tue, 31 Aug 2021 12:43:07 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 12:43:07 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 14:42:50 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [b8cH3jh1SlGc88eO3wxbDqj1fUsZd+bL] X-ClientProxiedBy: AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210831124258.1715917-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by AM9P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23 via Frontend Transport; Tue, 31 Aug 2021 12:43:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81c5eebe-f1c2-4822-0f82-08d96c7ce1e7 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSWRCC5t5rxqFZL3PDFc5wfoV4e8I7SD0xLd/WXxj/j/7Dc/PnCJmw0icRtGNubwLhtJeMGbnUJvRnkkGdHi7A6j2OpMZuZGPfeLxoaJ5t2ShyrhchxqlTaNFgR4clHxUkyQhivzwDyOuGI2iKL93xStz0MoVvyPRxdw0N9gIXmMw8TDFquCtaVbYyGdcnVHb9exmPu42UQGbAlJK2vc0OCoFJNIX0B7RXoq3WdhiUF1OnlJ3A5d7Ie2dcX8SGZO2mWLA132dr0I1wRjd0Ovn8zPlS2gM7Gsq7P/agEiq9hzUus39jJUtzmXCwKsYSU+nCax5ORD2aZzbg5HsuqQlITkHSd3PwhZd3jJT7oDrOSQ0xHNUcONfDWVOMBtIkakerbMzYA3Pw3+x/XugwyF12xROgJ/3xJJum4iYcZ4XrryjFkthTU1NeZ+ujp9Z5wUzN0v/bhU89Rhqa1VfgaWwdhashwwc2nAwA1e181NTogvrHmOiVN/Z1pgy45bSWbT0SwedC7piW9OGvAt9f7w//aKCV8QTHh7fF2Uv6vRSnOXF7skL1IdDHMuseh4LpRVexMnCgx1aRg9+wgAUms+9NT2te994LTks+z9ocYS7h4dqVqYNXucwQ+1bHECdkocoKMj/jrc7MayLoewxLjmipCkeAbbVo9dP6wjI4y/xUT4iA6hI6Pnxmc3muqsYE2ugaEiLVN1BJzgG7PBevswwHX9VNXl2PVFZF0HPE7CGEyc4ChwhCQGXthIWwD2Vy18wE= X-MS-TrafficTypeDiagnostic: AM6PR03MB6005: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oudYpNJizwkhqGXey4BrLBtsmSCl2svTnVkeNg8TIcQx3f9W34Msc3Iav3/kzDRgIGqq6mUT0CNsawv5m6m5xJc2ijpIIFPtRYG6iP0C2xqNZcajrjjkqanawa03h5K4rDbGrSOn7X0j7Hp5AKiMK5yPBSKYEt/wVd6eFgJijeJtD51crtGT6IfpkFgdZnqvZEQptnbssgRgFrXeVCoxrFEJ92WWT4SXmtNnu8sWi0Q3ZntPGEIFeN0A3GnVe5CsfQXl8i6xPguhi4MYLNBTDygOiRLSgAeVlAkQeWN3vbsgR/3v6tfORSejCVghKMhp9jGCIDJu+bIwJKSJEjS+Wsx6WhAXU97aCpkUtDCCzpMJ9nk93CW7qiNzHV1n5gk9T20qivD2CFcszA0rv9P2nui+mAfZLrtpNzhLT+OxOdY57zfFIFxShhiNzH/efcTe X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rQyXw6KSBo1q6RexnDlBALtpRznn1UxiWRVYCuojyQg8MYFkpTAJex7cYeD30Wzcf0PP9DrFI/TrbUXzXhI3FWX4t6sydSqqqgimcrO77TG8LBlq67rPnRge8S/CjZd8aXFCenoItb2Ud+H0dhEdVg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81c5eebe-f1c2-4822-0f82-08d96c7ce1e7 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 12:43:07.3308 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB6005 Subject: [FFmpeg-devel] [PATCH v2 02/10] avformat/flacdec: Also set channels when setting channel_layout X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: enTo0LcaERty This brings the FLAC demuxer in line with all the other demuxers. Furthermore, if it is not done and the FLAC decoder is disabled, the FLAC parser will overwrite the channel layout with the standard channel layout for that number of channels. Signed-off-by: Andreas Rheinhardt --- libavformat/flacdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 2060b48c69..d52434d2f9 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/channel_layout.h" #include "libavcodec/flac.h" #include "avformat.h" #include "flac_picture.h" @@ -192,6 +193,7 @@ static int flac_read_header(AVFormatContext *s) "Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK\n"); } else { st->codecpar->channel_layout = mask; + st->codecpar->channels = av_get_channel_layout_nb_channels(mask); av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", NULL, 0); } }