From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTP id 99D9442CBD
	for <ffmpegdev@gitmailbox.com>; Thu, 13 Jan 2022 01:58:39 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0131D68B063;
	Thu, 13 Jan 2022 03:52:45 +0200 (EET)
Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com
 [209.85.219.50])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4238168B042
 for <ffmpeg-devel@ffmpeg.org>; Thu, 13 Jan 2022 03:52:41 +0200 (EET)
Received: by mail-qv1-f50.google.com with SMTP id 15so5046010qvp.12
 for <ffmpeg-devel@ffmpeg.org>; Wed, 12 Jan 2022 17:52:41 -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=4vHn3N+M4ulb/kqBsHi75ABLQz1HnHUSbLcHspG4B9c=;
 b=ot45KRYWa0EpEGNJj4mauzA5myHfxNpn/R2zzgmzGuclEBtFsRCpDPw/As6tCFZPz6
 tN40xUa6e04SDpXGTjHkGYUL1VujehsR5priUAJqxjWH5oP6XyrQv/HrqGOmcgthgloQ
 kPzbWxtp1Cy5BYb89wEvc/9niUD2oWuUEJrEG3bY0ePwnXRse4D6OmCz9E/DXpDJIk6J
 xqpE+/YpmcwCvgsRuizpZ65sAHduKK/j0lf+Y2tC+EwDup6VSCVYK3swKuXgfZybtb9z
 4qTQx5StzXUA7bRUV90CJyoEn2y2vgwWia06RgUJT37eZHRFy+tM8qF5iV2/nMuRINxG
 2sDQ==
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=4vHn3N+M4ulb/kqBsHi75ABLQz1HnHUSbLcHspG4B9c=;
 b=Xj3iJhsqjayfsAdSRKKdExhbSkMylRuzHRhfZwkrKJf0G8dHOXQpTpJFQCMWZZGUJ5
 Ref916T9r6iB1h13KKbcyO5ku43SLshNm1iB38gbpCpZkHzqPAqlqgoR+bvCyF4TlBPZ
 Dr6DKqyLpKXkSy9uHtv35d6oxF0oc98ybSEkB8ijQ2nRf97dZK2wqlIEUkVVkGZPW2Iq
 JK//BMVA6vkwUhtnKBf5tM+WqbliGe1pHeY7bb86Ly2KnRJpjSGgvj55dDkymI7XpNYb
 Kh7ERWnwWiBK0Ca7BCZrQqjien7PY6Z3CeMlJG6ujEtQimOYL/TotS28iw3TLRWhIrm3
 C5Og==
X-Gm-Message-State: AOAM530UxWY2DX9BAlhvHCp2ofQN+tyQmDVHUsyUbUMFdicXrRRJI53i
 s3RbifEfx0iEC/WFevhfyXoVeXNJjSM=
X-Google-Smtp-Source: ABdhPJwdoCjbqkXxmlFltkOy1UQuov3XG1yGqwlW2Mi82KhrZllxATvFP3xtBXnnHherkBqil8TxBA==
X-Received: by 2002:a05:6214:2307:: with SMTP id
 gc7mr2207644qvb.77.1642038759897; 
 Wed, 12 Jan 2022 17:52:39 -0800 (PST)
Received: from localhost.localdomain ([186.136.131.95])
 by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.38
 for <ffmpeg-devel@ffmpeg.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Jan 2022 17:52:39 -0800 (PST)
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Date: Wed, 12 Jan 2022 22:49:55 -0300
Message-Id: <20220113015101.4-34-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 033/281] au: 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 <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20220113015101.4-34-jamrial@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/au.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavformat/au.c b/libavformat/au.c
index 9bd408f65c..1de941e555 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -213,13 +213,14 @@ static int au_read_header(AVFormatContext *s)
     st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_tag   = id;
     st->codecpar->codec_id    = codec;
-    st->codecpar->channels    = channels;
+    st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+    st->codecpar->ch_layout.nb_channels = channels;
     st->codecpar->sample_rate = rate;
     st->codecpar->bits_per_coded_sample = bps;
     st->codecpar->bit_rate    = channels * rate * bps;
-    st->codecpar->block_align = ba ? ba : FFMAX(bps * st->codecpar->channels / 8, 1);
+    st->codecpar->block_align = ba ? ba : FFMAX(bps * channels / 8, 1);
     if (data_size != AU_UNKNOWN_SIZE)
-        st->duration = (((int64_t)data_size)<<3) / (st->codecpar->channels * (int64_t)bps);
+        st->duration = (((int64_t)data_size)<<3) / (channels * (int64_t)bps);
 
     st->start_time = 0;
     avpriv_set_pts_info(st, 64, 1, rate);
@@ -304,7 +305,7 @@ static int au_write_header(AVFormatContext *s)
     avio_wb32(pb, AU_UNKNOWN_SIZE);             /* data size */
     avio_wb32(pb, par->codec_tag);              /* codec ID */
     avio_wb32(pb, par->sample_rate);
-    avio_wb32(pb, par->channels);
+    avio_wb32(pb, par->ch_layout.nb_channels);
     avio_write(pb, annotations.str, annotations.len & ~7);
 
 fail:
-- 
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".