From patchwork Thu Jan 13 02:02:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33481 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp39856iog; Wed, 12 Jan 2022 18:38:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxihkkDWuAPHZdlON+8SIIL8Q37ZEDtWWTgXg/2UZ4P0NnwBM5A+x0VYcqo+vkW6nokykOa X-Received: by 2002:a50:cf4e:: with SMTP id d14mr2330706edk.2.1642041495758; Wed, 12 Jan 2022 18:38:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642041495; cv=none; d=google.com; s=arc-20160816; b=DiiIzEsfgJIyfq1yquUnsEu8ec6GnUB60jZjRQEecXUwQfdmQdobjZdTNKQkrxWlK3 Ea0JWCUJB3uOKlQpyna7bSnVnqdar7EhOCgTXmE6u4qbkbbK6M3oO7ku7EbclakHMCvT paeqONxWmBVy460zgt5EhNtWwbL0v4TT8mYtTdE6J4urlIXXbSGmoJWWeaIjuws6xqDL nWty/oJC5nCWdZbsHz7C85Xglzl6HUY4GxCOnxS4IsXrglR8JlhICTwsaLCyjpNH5dv1 R/lDilbnBZ6V4GReggIpBBnfo/zf4+k6ICnT/Blpks0Q4Zui9sMiOMlanzd5vz6+bPWK sN0A== 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=gOFmPLZVgHl7ZjB2meXVjI2ghFGQvEyEudFo8t8326g=; b=ke2yHGXqCWmaXogYBv3ECb+U1iGcvcUoVZpA9jJrbKc52S/umgyqp+kqpz9+hudqCH tpObIFEj6Khtf930B4I0Wmr+88eBfVrv5CeSsU6Hlf30RxNhwO1qoHxdV5KDPoTceufw EH3Q5OrImGFuNiUwYKilyQ7hUSXn6nxLz9ve3i4aBeUPiRMnyDX9R6K+o1YVXq5Xjz0H +m/P5VwNYq3GyfYUNslQ5kBbJKzOy7EihyHxdEkISr5gNEyC0mOhhmLH0GiDhqq36ble 50cUv5dnTR+Lonf6LVavJflacl1QQ50MWZ3Ts1P/oJ0ggN0nbF+EFsT2T+hoL40QwZZI 6AZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Jah8mk0J; 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 m11si905432edl.204.2022.01.12.18.38.14; Wed, 12 Jan 2022 18:38:15 -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=Jah8mk0J; 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 DC02D68B7B5; Thu, 13 Jan 2022 04:03:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5FE2568B78C for ; Thu, 13 Jan 2022 04:03:31 +0200 (EET) Received: by mail-qv1-f44.google.com with SMTP id l13so3605554qvz.10 for ; Wed, 12 Jan 2022 18:03:31 -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=2t8H7GAnFt4shiyEyMhYTzPjZ8/pcAQLZ08G/mrWiZQ=; b=Jah8mk0J+jEpSyqZ/ygmwbphLLqh1OZd4aWy5dchp6glDd1B1PtZlgkaEhk1HCkSaS ncXrFNlryl6Wcijoho9cefoez/lJRqRcSllHl+No8igkTPCoW1F5wiBZvzKpukT6VbyG xdXzZgroA7vPK/4vwRPyUUmLA8hBZByttedRWbM2r5D/3BGQRkAFsF9dhnMgchMixdLd jxRz0iw83gX4XwPzP6x2uYWSdbKC5mPqrmKmM2QFAfr4PYBRV8iQKlu5xnOj4EFEsYir YIbjvopyu2SnumQSvSrLzgDzu1VLb2mWaD2capIqdSLb6awZcEpcsx6AX09yJNrXKbN1 UdYw== 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=2t8H7GAnFt4shiyEyMhYTzPjZ8/pcAQLZ08G/mrWiZQ=; b=jq+8WpZzm6lP+siyHrbJ+NUZbanPCn2e0Erq5an7/XvjfP9h5picfyMuE05cGVrSp2 aj9K5++fEwDFrcyew1GSTzZAPuJxkIpfVIFY51yMfK5rkR/A6kWEWGeKsznYUf2a9fEo AQu8e3tj8+N/I0stbaI2r0guFYKWVrKnAjPcB4xkHw7x1cT214/Ousf2bfzKs2KgrtlZ Q9tZrprDntvjFYUPET3gYdSJQqF0Kd9m89KojlTbgHFYl63hhCyh5tQmdSO7jqNVcRIR 1Byzb7alwD1p7AHOEO1kMSCqw8vEvoL6yN1AqomlCWKv6zsRbXY4C4W0ur1zAQSmprE0 1C0w== X-Gm-Message-State: AOAM530xlL4ZzNb8ibfAW7HCVt11xp3gAPcEdmyXc5uX+pgpX2cZxZru 1Nbyz1MbH77J9SqFIkB02X7v0SVAgnY= X-Received: by 2002:ad4:5ae2:: with SMTP id c2mr2118922qvh.99.1642039409977; Wed, 12 Jan 2022 18:03:29 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id v1sm1045961qtc.95.2022.01.12.18.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:03:29 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:02:40 -0300 Message-Id: <20220113020242.661-28-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 207/281] dvaudio: 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: JXMQyCCBmXrK From: Anton Khirnov Signed-off-by: James Almer --- libavcodec/dvaudiodec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c index 82e6dbe36c..f3b1dee075 100644 --- a/libavcodec/dvaudiodec.c +++ b/libavcodec/dvaudiodec.c @@ -36,11 +36,6 @@ static av_cold int decode_init(AVCodecContext *avctx) DVAudioContext *s = avctx->priv_data; int i; - if (avctx->channels != 2) { - av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n"); - return AVERROR(EINVAL); - } - if (avctx->codec_tag == 0x0215) { s->block_size = 7200; } else if (avctx->codec_tag == 0x0216) { @@ -55,7 +50,8 @@ static av_cold int decode_init(AVCodecContext *avctx) s->is_pal = s->block_size == 8640; s->is_12bit = avctx->bits_per_coded_sample == 12; avctx->sample_fmt = AV_SAMPLE_FMT_S16; - avctx->channel_layout = AV_CH_LAYOUT_STEREO; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; for (i = 0; i < FF_ARRAY_ELEMS(s->shuffle); i++) { const unsigned a = s->is_pal ? 18 : 15;