From patchwork Thu Jan 13 01:49: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: 33323 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp15714iog; Wed, 12 Jan 2022 17:58:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1/nzriKdMJLJItRtjUgOXmL4xIR45csfTOJ3QKRXUkBkcY06cI++ynvt1nQcZjFe/Bnml X-Received: by 2002:a17:907:2da1:: with SMTP id gt33mr1903262ejc.590.1642039122769; Wed, 12 Jan 2022 17:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039122; cv=none; d=google.com; s=arc-20160816; b=0Dm6VhCgYzTGjDM+id9/eDQy4oopEyS5q0RtEkeWGLYNF3HrpTeoPBk4BhfCY3O7h7 zVkXzGgomGgPZIAd6Bwdk3zRQ+EtL9xYvpa8OlbeXs/AiwYC3hMxVp4b3yGZ4/GGSv3s Z2Z+H+6EhWKjFhts9O+YrOCxafRSQ7Jr5Kw6WTi15Bm4Qp28SZchZ9IQir6OYOjk73yM PeKfkhYnKu1+KGt/i6LVIS/EVRVUuIaq/RsB/driLOBSw8Vlu8kkmKIpUllo7g8DuXMO 8xCQSkuxOq/s64XcTcKW4N7dj5zmyxsQ/f7oEb2AyEndzfqD5r75Pij2CUjGSB1NJWMS fEfw== 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=ErU8335YGZvc/KYhu9iQNW9cH/BkXdxpjS0C0tGgTYI=; b=EjEKHXlPpjzqy4LJN7AlMGGeh/D1/SIIBJQ3jcXEvOPCAPZyItZfRUbmlkSky/dZFp J3Q7dwx/9XoZ14jCfAyBganaB8ZofrgsoRi5wt8NVXLIDeu2U29GzDL21Fdl3KErFEm4 ZQ0vuUk4bghsdIen0pibsFWTqUOagwFFkToCyGsB6xXTalyaVeHISfx11UuLdcdCJKNf X7aE8Q9j1kqihmLOm5tug7vm1M6IrbhGVqqDsB49BCM2yh0xOJ+ziyt0a9+w8ld5k49E 5rHCMyc6y0xEkA4PS8/9YiUP798N0aFfGemddoVcwqqVycqJSLLA5uUnSOyCoo9uibUj WySQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ot45KRYW; 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 dz15si1185818edb.398.2022.01.12.17.58.42; Wed, 12 Jan 2022 17:58:42 -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=ot45KRYW; 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 2F57E68B064; Thu, 13 Jan 2022 03:52:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 ; Thu, 13 Jan 2022 03:52:41 +0200 (EET) Received: by mail-qv1-f50.google.com with SMTP id 15so5046010qvp.12 for ; 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-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 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:39 -0800 (PST) From: James Almer 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 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: OpJdvDCAiZOj From: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- 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: