From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 278E842DA6 for ; Thu, 13 Jan 2022 02:14:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 845F268B287; Thu, 13 Jan 2022 03:56:44 +0200 (EET) 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-Google-Smtp-Source: ABdhPJzr5aRyFXSvb4OOkIAysq1JVdwYfRnPe6IA336DEUYX1q/tVr9C8tKsYfuFgBftruQHrqBx5g== 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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", -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".