From patchwork Thu Jan 13 02:04:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33486 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp40841iog; Wed, 12 Jan 2022 18:40:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJykK0mPYUNJr+fYlteZ82MoTeDcQeU1P6ms2L6p3d7ndXureTF6BJotEyy0se+DAzke8Q+o X-Received: by 2002:a17:906:f54:: with SMTP id h20mr1999377ejj.201.1642041612631; Wed, 12 Jan 2022 18:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642041612; cv=none; d=google.com; s=arc-20160816; b=Llcxhcn1ozT7rRZOeeH/FlopJwkVMq8rpHrGGHSEDgbniMPbb4Sqa59OlRpSIa7bdj vZpXuexAQ+I4L232LVqMastX7KXdF1/1Q3db7qkw692qgxS7SKtgtpt6AmDpfqqpnz3s RhW60DK7M5DpOktGd3tyMKA7y/56J3Qz34A+nAeDM9JFPwnqR8ybW0BNcKPoBSjNq7o8 28U20F5Zmo+a0XHyqleXAfkxktC1hRawcEg4yQ0fV41mpciyWUEPyk69VBq3mu0tSg5V 57eFgor6YJ8ljXNKKJjYDZTsdDEVMsEMQDVlDF0GT8togITGnd0Ii9hltpwo+4x2JaGs ssXw== 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=iD3gOty9MG20kJHDP0AOUnblHc5++gMQtKBNt8JdSSA=; b=QwmYEzaD5rWp9baY92l3IA9kKuv48qljAumbnJEh79WmQWiAEhOY6d8n40ZTO2tFfp acUPBo+x8TeGz1ARsPCyZqzunqH4tCWnPgBL4L3quNCEEDUCTwhozH8OViNbJPMEyxPV qqb28oHA1uO4FayUq6sA0q2/ulYoezMjOl/LIDWLbX2+pxT7pv0plLtk6YQr1Whx/SBC m2iwDK+vw+RBJZVeoF33Zu9YyMtVVDThpaE9e15xoXCmh6DaORGi2bLns0o96ksSvcM6 yuQyJzpwAumnSHI0CTM5nOxiFEagtNV5KNie5rQAI+clCqhKdLkeXOCbaJgdErjEr0wd hCVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Jn4n4C7K; 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 c18si796270ejj.612.2022.01.12.18.40.12; Wed, 12 Jan 2022 18:40:12 -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=Jn4n4C7K; 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 84D8A68B867; Thu, 13 Jan 2022 04:05:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C941368B825 for ; Thu, 13 Jan 2022 04:05:37 +0200 (EET) Received: by mail-qv1-f49.google.com with SMTP id kc16so5158004qvb.3 for ; Wed, 12 Jan 2022 18:05:37 -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=yepPvlQTEReUUnMoSV64k0X48xsUGvKbTu18ewDCzgU=; b=Jn4n4C7Kog8YmxOBLBNzmL2Qm63TpygnsPLinCzbNVOKHyaxufUa5GtbQJPFH7jPMx FqjnGJ9+HxE2U7/XIkVSkigIQI6NOdgmyvbBYWmC12lv9TtAspD9/vlyw8oLUCUu+yMQ EBbpA+rkKpeViAr4WkFuutpV+OPIy1qIW+2T/8ShqZ4uLAvzFzZI2iyM6Euad848pEbR O2kHVvF+dVPe/XUFMeIHyo7W5WbKJXc1L1dxqROG2/Y3KhmFvfJ8ArjnsZaIrt8NaJWr sZ89d3w02fGQA+uzXFtbkRpBulBGLvcq9UvZ9Dqsvl57l0Jer9/gurWE4hO3jN+8ed8C hcWA== 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=yepPvlQTEReUUnMoSV64k0X48xsUGvKbTu18ewDCzgU=; b=Y7XAbIhojRDH7TO4ZlqbF7uzon2cJCHVl+P1uprTLOm3xAFWKEvH2DJdZ9vkL7Yfl2 0EXNSgk8I/RrsrMxPB0GpJg0cl3vRCLwJ1HROCJbs14bD3byHlEk46dEhVL65iuJQI9n 0nalDw+UNDg3xFV4V1I9VLoYOVTan77A4pnuikkDAcD4OwgWBbxcnF+tA1LWqt6giUNU aZO+X3lLP2XB48AFXDFHKPRDKJXOG6i0gybJyem7cWWuOpVL5XQ6NrHdyW6MY3VjrCac AJjxIPl7bmVkBPOuwVf/FNjQpwW5kJAcW/ZSKFGu91/HhwWO8ZFHFBSd9pCQPYV3mfqN Ui7w== X-Gm-Message-State: AOAM533jPf8+GKvIo7wcVEXYePgp2D262r2IKH6r9BFZk1pnwFfDpPHE s9vU+hgazT+HQXcLi19+BKEiGJEElJo= X-Received: by 2002:a05:6214:20e5:: with SMTP id 5mr2294060qvk.53.1642039536505; Wed, 12 Jan 2022 18:05:36 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id k9sm1264556qko.29.2022.01.12.18.05.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:05:36 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:04:53 -0300 Message-Id: <20220113020518.730-5-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 214/281] g726: 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: PEYGoClLtzf1 From: Anton Khirnov Signed-off-by: Vittorio Giovara Signed-off-by: Anton Khirnov Signed-off-by: James Almer --- libavcodec/g726.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 2a0148c1d5..082f9b07ad 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -324,7 +324,7 @@ static av_cold int g726_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if(avctx->channels != 1){ + if (avctx->ch_layout.nb_channels != 1) { av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n"); return AVERROR(EINVAL); } @@ -436,12 +436,12 @@ static av_cold int g726_decode_init(AVCodecContext *avctx) { G726Context* c = avctx->priv_data; - if(avctx->channels > 1){ + if (avctx->ch_layout.nb_channels > 1){ avpriv_request_sample(avctx, "Decoding more than one channel"); return AVERROR_PATCHWELCOME; } - avctx->channels = 1; - avctx->channel_layout = AV_CH_LAYOUT_MONO; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; c->little_endian = !strcmp(avctx->codec->name, "g726le");