From patchwork Thu Jan 13 01:55:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33381 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp26303iog; Wed, 12 Jan 2022 18:14:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHHxwJyR/YTC+Dy5DXeJv/Jx37iH1u7fhWYJlququOeysZLqFIazuixBzpjB/xvsOG1tJK X-Received: by 2002:a17:907:9707:: with SMTP id jg7mr1908972ejc.508.1642040050971; Wed, 12 Jan 2022 18:14:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642040050; cv=none; d=google.com; s=arc-20160816; b=BO3gVRQX1e7bGhbW9X8Yy4Q5ICk4GMWUmPohrYQTdjOCxMmJYYEHRfg/ApBzXIe9m2 L7oc0nmVf9cWkBOMYJzdM7E99uaSGtp9o5EisjoCOxk9iNIfuxLxV3QwKejd7hpGMoXv QlOEPSEEo4gnyOiCQOxhokyNrQ9x3pMUe3d+2wV71G19VQ4BJXpCmqTQl1lNPrT11uTR rA4k2Zs1fczvaqa+umNajCwB/inX0AeGtKveNrXKGfFxTjyQzxDVss+KfTRM1fZvois4 NUpb99P/6/Pj1j4vkbT9iUFBRMsu4LKYyrR/s4yVlFJfdGO4lJyn9mjWc5OwiXb8mw+N 00ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=QyVf+moD8DwgF6N5e5O5ZdBG0h98VGodfjEkImfFNsE=; b=lcM3nrxzlBd1j29uiKJHfGbEgtg3ARGxC/RX37KPDIi6RyXoq4CGsMSnCO8Wo1QOn+ 44bQYWnW4dPwI9B4QaemZvLi6J6lnvnTdYW5dnqqsluBPR9xcSTMyF2SH/h8q3UXzw7z 0v2chYnpyjZwy07FnGEjfg6CYagfpVCGheya7MDMDXReGrpgxpPFOmvpxFVF+I5RR3kB cIDPzkLRoklzTYPNSImcItAEPnTqcrugMeWe0RQ/Y38fo2tPcPS0uXKULy0GESc7XYtW diKlO/lkC5ZuZ0PfxYDpz1Ka3SIsUdOs74MpkIsGIRV891nQDtP/KQldRv75Hc6Zz53p XqUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=COwZg7j+; 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 j8si686045ejk.518.2022.01.12.18.14.10; Wed, 12 Jan 2022 18:14:10 -0800 (PST) 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=20210112 header.b=COwZg7j+; 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 B348768B268; Thu, 13 Jan 2022 03:56:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67E5468B270 for ; Thu, 13 Jan 2022 03:56:42 +0200 (EET) Received: by mail-qk1-f172.google.com with SMTP id bl18so5569154qkb.5 for ; Wed, 12 Jan 2022 17:56:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=xoPexwSbXhupaaaE9MLQNwCpOl+R6L4lxEqpQCQ61S0=; b=COwZg7j+8C5xwLPCCyGH18KraX2XL73O3lNbXLYyMEmm1v8AZA6YYqjfQKhoVAqzTk UkpfpjKi4trkWgF2iL5z0J433PUsrdaF5crYu8pRoc+uMDeH2q/sdxt2iTKl+PvbuNUi QQnjaxOij14tCpeUTKtwBhNTmyaAs0+QIA0lQ4Y55DuPyEqNZ5SF8k9lLbMOcK+IRL99 A4np2VOlqoUnO0OwQ+je3Xtgs4+OcfJFHF4zIfhHOfx+ELVZwEzP1kIYfxcf0xBqkMbZ rc9ZiiFnLv7VEYDhDi0Ls8d90Aw3qXYDmvX5UUEFA+7mYRzzKyNj37UFb8oEVlIPqxPd y0rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xoPexwSbXhupaaaE9MLQNwCpOl+R6L4lxEqpQCQ61S0=; b=MUJAEVRdWGlODsYKFDsWGc3Qb7JnzR6jdu4JgCpB23xcKA//Yp712kAUhwJu73N8i1 NuP3aQcooHDLXDJ+xWk3y207+4AZQIjukkljJjo7T0/x7eXdSh+QFfOnojb/wg9GPLzN PLkM5l0Lxn41JWoCK+TJkHAGQVxZhQwLcTU5tlxg0m+lvZNhkJaGVbriBwMDhbWayY3s Qtv61NmfD5K0eyo4627Ayq93hnO1/eD4U+dOjYkS5lzraEKkl0KBo8CcVZkc3mMNuwzy mF5nLwFza8KxctEl4fTgEePQXTDtCyL3MNbf/MtTn2jWU1m1qfzUsP/AyL+FVYulkaCj vHOw== X-Gm-Message-State: AOAM531/8k4lePR866uZbFeedU9jLJ1DhwFoCsmIQVEN00vbi4ow8yGc au5Z7xykRDSo+yT7dl/Nx9YFi1vNqTU= X-Received: by 2002:a05:620a:25c8:: with SMTP id y8mr1883866qko.455.1642039000994; Wed, 12 Jan 2022 17:56:40 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id t11sm906506qkm.77.2022.01.12.17.56.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:56:40 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:55:55 -0300 Message-Id: <20220113015612.448-14-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113015101.4-1-jamrial@gmail.com> References: <20220113015101.4-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 102/281] mpegenc: convert to new channel layout API 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zP3aOum0EWrk From: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/mpegenc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index b1d8bf9c38..3b5aefeb30 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -380,14 +380,14 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) av_log(ctx, AV_LOG_INFO, "\n"); return AVERROR(EINVAL); } - if (st->codecpar->channels > 8) { + if (st->codecpar->ch_layout.nb_channels > 8) { av_log(ctx, AV_LOG_ERROR, "At most 8 channels allowed for LPCM streams.\n"); return AVERROR(EINVAL); } stream->lpcm_header[0] = 0x0c; - stream->lpcm_header[1] = (st->codecpar->channels - 1) | (j << 4); + stream->lpcm_header[1] = (st->codecpar->ch_layout.nb_channels - 1) | (j << 4); stream->lpcm_header[2] = 0x80; - stream->lpcm_align = st->codecpar->channels * 2; + stream->lpcm_align = st->codecpar->ch_layout.nb_channels * 2; } else if (st->codecpar->codec_id == AV_CODEC_ID_PCM_DVD) { int freq; @@ -404,10 +404,10 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx) stream->lpcm_header[0] = 0x0c; stream->lpcm_header[1] = (freq << 4) | (((st->codecpar->bits_per_coded_sample - 16) / 4) << 6) | - st->codecpar->channels - 1; + st->codecpar->ch_layout.nb_channels - 1; stream->lpcm_header[2] = 0x80; stream->id = lpcm_id++; - stream->lpcm_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample / 8; + stream->lpcm_align = st->codecpar->ch_layout.nb_channels * st->codecpar->bits_per_coded_sample / 8; } else if (st->codecpar->codec_id == AV_CODEC_ID_MLP || st->codecpar->codec_id == AV_CODEC_ID_TRUEHD) { av_log(ctx, AV_LOG_ERROR, "Support for muxing audio codec %s not implemented.\n",