From patchwork Thu Jan 13 02:02:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33483 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp40032iog; Wed, 12 Jan 2022 18:38:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNcr2DW7+bmn8luLmIVN2JFefT7u4FsQIYl31u+m/3QiI+jEh3qX532xoKIcV9RhoOHUkI X-Received: by 2002:a05:6402:b88:: with SMTP id cf8mr2377897edb.284.1642041517785; Wed, 12 Jan 2022 18:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642041517; cv=none; d=google.com; s=arc-20160816; b=uS/OmsntQrwVu+JPNAXVejWQHBahIz0LcqZWXgqdqYIj3D6h8+kebPx26ojzxLWjqn V1J6lIXv9ozedXqBRoD2QN6d/8vspXe2UTnEiNIBPwzXDv9vHTz0FYMTEbksjoyrQ08s QinsBTsMf/XB/KHNhJb31D/qpqeDc2CoqaleJmAoZYdq0z4/QArDs2d7DFXAVsmMsE4s hE/dVWk37SUeq42VDHetSIePDy3IMqRyVp2GEQ5ypvwSlwpl/Q8erwVhLJVMSaNp+Xuq f1cIJPr69FFWD2HPjyU4yg3RuqUG5QO7VPyv1o2mXC7xph3JE8ApY3zKmTJQy0gB/JXH gBMA== 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=tPRIHkXaClGJzq4Nx8+q95xXs65Pjpz/mZ7tur9kuZo=; b=CamhidNR8ByQ46k3jcDBSPoezTAshZfd2Wzi5HSMEb+ON8abtTbHVupbDVdtKOXLby XTNz8bOnOwtgE0Np9QXxoPOajTzhrAdn0SHSiHK3LnPtPJfXqd1ufrxX3fo2mfD/e6GQ GJB297YIwW9Ek2q6cKAGPzmdrd020v6wWHZaVYWRQzRIEYktJCd3s2NdfekK3+AOBtOj L/HFC/Q3vEleRU47e5jDbuazcKho/f3ktp27RZGEcCdYbYtJn8WaU52JNjFXC7TxVeAf GDKO1bT6AcZ+JXKp7BA5bxQuP02Nsnav4l2TzqYGS1wfWUgDc9hRCVRc595fkjeOzFbd 0q+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=qkiyQE5o; 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 q12si888767edw.152.2022.01.12.18.38.37; Wed, 12 Jan 2022 18:38:37 -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=qkiyQE5o; 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 9286568B7CD; Thu, 13 Jan 2022 04:03:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DAFD268B7A4 for ; Thu, 13 Jan 2022 04:03:33 +0200 (EET) Received: by mail-qv1-f41.google.com with SMTP id q3so5132724qvc.7 for ; Wed, 12 Jan 2022 18:03:33 -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=XqjAHjYySfZqn+EfM0ddPJ+mNj3SFvF2cdSe8h2ElmU=; b=qkiyQE5oPmHRVUhuWFQxlijgj/fXbO8Xfo5mnqJw3F1bEA/koOpxjnwjqSZI0t76F5 SsSbFnUGs9EbyeZ0P6NqBnTPlnRkPoJ3QnCgCDdBJknnUTsF/SqJ3peYRcDvG1/Qv99i 3T0le2AB16J6Pr6jQpjnbjw7KC9X7WhVBLbg42Am5wN1KOVpf/DEGHs4eugLi1zoDcOv WWEWRV+8Ep0JBTEU3FmhO6iZXu+4q6R9ZIR4L3a4YPU9iTHflc7BuBNX/kqe++pxwcYI 5R7S761CYrY0fkYGQsR7ph4Fr5gR+uUxLA+wRMSPwIRS72XZU8KmDi3oRnLZgMIV5U7K iX8g== 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=XqjAHjYySfZqn+EfM0ddPJ+mNj3SFvF2cdSe8h2ElmU=; b=VFDlFYuytWsY/JSXGcdlNT6dEwB4/deWlPQ0R7OgyzTeDgd5RfD16g9EVRoWU496jy /2cTIEg39fOtLkAZtv8TDfaRL8swETQ2c1G8JFQSoryK9Tnw8iDu5fFslHzg4gWZfPet Atw36Wd7X0e090NzB8SboR6/Ee9AbRtmwuPcM13N56Pa6S5sPjWYcXQyX6bVrgm244Bo MbMIQNZhbaXEX+xFZ1woTDda44UnuYWKemHN4ZUPMPDyLZRb4W7Q7H6D5t1shldM6jOC qmvGub7vfCUWesSoNTnR2JnDFiHlhci2MgF9DTgkqAjhIJ73umX1JQkELWtJJUilUI/U 96ww== X-Gm-Message-State: AOAM530Q57z54r+6Jxmm4eGZlb3f5r+4Qy7+UsWBrhZpK5p080GNH6E/ Fnup4H3r4iWemB6QpKTrqvcJ296CUeQ= X-Received: by 2002:a05:6214:27e5:: with SMTP id jt5mr2109509qvb.113.1642039412437; Wed, 12 Jan 2022 18:03:32 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id v1sm1045961qtc.95.2022.01.12.18.03.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:03:32 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:02:42 -0300 Message-Id: <20220113020242.661-30-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 209/281] fastaudio: 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: g+FUZra86arK Signed-off-by: James Almer --- libavcodec/fastaudio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/fastaudio.c b/libavcodec/fastaudio.c index a07c5e60a7..7a8ff7dec3 100644 --- a/libavcodec/fastaudio.c +++ b/libavcodec/fastaudio.c @@ -78,7 +78,7 @@ static av_cold int fastaudio_init(AVCodecContext *avctx) for (int i = 0; i < 8; i++) s->table[7][i] = i * 0.34f / 3.f - 0.2f; - s->ch = av_calloc(avctx->channels, sizeof(*s->ch)); + s->ch = av_calloc(avctx->ch_layout.nb_channels, sizeof(*s->ch)); if (!s->ch) return AVERROR(ENOMEM); @@ -113,7 +113,7 @@ static int fastaudio_decode(AVCodecContext *avctx, void *data, int subframes; int ret; - subframes = pkt->size / (40 * avctx->channels); + subframes = pkt->size / (40 * avctx->ch_layout.nb_channels); frame->nb_samples = subframes * 256; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; @@ -121,7 +121,7 @@ static int fastaudio_decode(AVCodecContext *avctx, void *data, bytestream2_init(&gb, pkt->data, pkt->size); for (int subframe = 0; subframe < subframes; subframe++) { - for (int channel = 0; channel < avctx->channels; channel++) { + for (int channel = 0; channel < avctx->ch_layout.nb_channels; channel++) { ChannelItems *ch = &s->ch[channel]; float result[256] = { 0 }; unsigned src[10];