From patchwork Thu Jan 13 01:50:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33610 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a05:6214:122d:0:0:0:0 with SMTP id p13csp996824qvv; Wed, 12 Jan 2022 18:09:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU9nEBZCW3yQDwnkZd9BiA9Ci6Zy8q5HGooO3sjbQk7TmQfa7qFm5ldno4e5if0mcae95r X-Received: by 2002:a05:6402:348b:: with SMTP id v11mr2240625edc.309.1642039774788; Wed, 12 Jan 2022 18:09:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039774; cv=none; d=google.com; s=arc-20160816; b=y/RZsc41xSXnyGhHrwq0gWHNK371Mp5wCgGPzq3rj8QOanWiCYxPxekBzYG6fm7Lhv nJOp4KiHQsbdDkBDPFolLA+za6gaPMQtx5B/Ffq1GmBxwNsUUR0V+WFB8VvgJKFMFHWB ekzaMsvZh7oGOYOUZ8DTL7swsLVrPb4UZw6aT8Tw4pMGyqc4X1fihe7Z3oi+5QFnRoeH Io0bBCZg0ax8Wv/kERAkSpWyiVsdqxadvE2ZFRo6qv+BiX6R6ZKmy5Ldu3wXoS818Z9P oA5rFxmv/lM2uC3HWNOZdbZWwIUnb3LnCmcf5HVgPrD3aw/Un5VOgqz9aYqlPq/coySC Hx7Q== 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=yDQPJZGbCYnKiNZFdv/HsvkPrdJjTx6C9l93H7zten0=; b=YJ6BOgH3x2Uq6HmySR0tfTZxkPXuZMBXeOzvgBKyEs5+/DhuGxjmetFKHyDoazpiTO hubDwsem5l9UvffzkHtJ20MDGVYN+tLt1Vl2lQ5iYHiocaCD4OzJXCnsh8tmpaL64QLn gYza8Oo8aPPWTvw2ZEENVFsYIJaMZ2ZeQaOYzq7HPI5gbTxTF+fVM2gin92IyR9emado mMxey7uGn/gzFiOLk2iEoQM9dha4v182Js6NtuFHFzzXsdYbunLG3yiPFAnxVylhg9oS w59jN5OnbfPCuEpK4N0GsxSfeDx3/5zF0ylytc+U9FWxMlvrWLvIUgPeM0npqUh5Hsgv 1i/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=TCl8a8b6; 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 nc21si819291ejc.660.2022.01.12.18.09.34; Wed, 12 Jan 2022 18:09:34 -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=TCl8a8b6; 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 11BD768B1ED; Thu, 13 Jan 2022 03:53:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2CD6168B1DE for ; Thu, 13 Jan 2022 03:53:40 +0200 (EET) Received: by mail-qt1-f169.google.com with SMTP id c10so5368004qte.2 for ; Wed, 12 Jan 2022 17:53:40 -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=pPK1NVnoySNmIMq8bXjzLenJQ1rAFEeuwMhAhOBt4ds=; b=TCl8a8b6Xp6K+xzNsh5kfuZmzg3b10jX1uS5GDCfwcNQ60Fbu1xEqTBsMvgsBSE+0s Shyj82Jo4fmyZXVAxTeYzsj8jzcuE5ojnYSwMEyo0uSn/n3T/laQSB3tuImUhnLryICm IuD5UO/ohHaylVaV1paQ1Z3+N7YD83XOwMIC/K3I/3EM9ae/esM6WuGb9QgFJ7jEkaFH WnLqUyJ0fdxbuXcmG78+kcQBjXZaIx4FYgo6Bage+w0yJR+Ch8FmqUA2+Juw4nZ7g6KG aACGvQjmjy3C6qkEcktL9L9JsJnTAoM9f9QWzpRTpAVWxAYl4znddRYxkZN++eYBDcNX gWeA== 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=pPK1NVnoySNmIMq8bXjzLenJQ1rAFEeuwMhAhOBt4ds=; b=aWQSXdwe7Jagwmbc74BZ8jbelYyw9W7jm+0kcSV1RRBmfpRcRjIxIbms+kFDuYa2Yr 9zIjDdujKzHAgq0IWTkJOpyOY5BMHap2su1wykSfizofsFUxsLUGez83Qc2o+0pVYyjn /d1Ej8zAlGjUvJ1HsjsVLkICYfFEcc5JVTqAL8S02H5X/zFQQsT0hvP/NAF9QmOGcUOm IA3LqPF7y3GqOKvjyuCdafbi31x/mK4jDUuFs06nWmOulVmoWTJe+mRyyDN5tBJGW1GJ PE5WgrupviDtmeQZjwjJTr+HDCJlDQUkquVZWnarSgPqbSBgc7Lhqu4ISNZtT7QyXODK Dk/Q== X-Gm-Message-State: AOAM531TFrYQ2C/m/uCOaS1j54yHuvXvJPWdKJZkKytBGB2UC7HtFX7T DwWZUDYCmygTL9JegtEdsu11T9MPDZg= X-Received: by 2002:a05:622a:170a:: with SMTP id h10mr1971455qtk.497.1642038818020; Wed, 12 Jan 2022 17:53:38 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.53.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:53:37 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:50:43 -0300 Message-Id: <20220113015101.4-82-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 081/281] ircam: 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: jo/z4PjMI1Ky Content-Length: 2156 From: Anton Khirnov Signed-off-by: James Almer --- libavformat/ircamdec.c | 8 +++++--- libavformat/ircamenc.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libavformat/ircamdec.c b/libavformat/ircamdec.c index a05ca5c9c7..a8927a3733 100644 --- a/libavformat/ircamdec.c +++ b/libavformat/ircamdec.c @@ -87,8 +87,9 @@ static int ircam_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; - st->codecpar->channels = channels; - if (st->codecpar->channels > FF_SANE_NB_CHANNELS) + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = channels; + if (st->codecpar->ch_layout.nb_channels > FF_SANE_NB_CHANNELS) return AVERROR(ENOSYS); st->codecpar->sample_rate = sample_rate; @@ -99,7 +100,8 @@ static int ircam_read_header(AVFormatContext *s) } st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id); - st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8; + st->codecpar->block_align = st->codecpar->bits_per_coded_sample * + st->codecpar->ch_layout.nb_channels / 8; avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); avio_skip(s->pb, 1008); diff --git a/libavformat/ircamenc.c b/libavformat/ircamenc.c index d49a427b25..df1494b2b8 100644 --- a/libavformat/ircamenc.c +++ b/libavformat/ircamenc.c @@ -44,7 +44,7 @@ static int ircam_write_header(AVFormatContext *s) avio_wl32(s->pb, 0x0001A364); avio_wl32(s->pb, av_q2intfloat((AVRational){par->sample_rate, 1})); - avio_wl32(s->pb, par->channels); + avio_wl32(s->pb, par->ch_layout.nb_channels); avio_wl32(s->pb, tag); ffio_fill(s->pb, 0, 1008); return 0;