From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9AF7942F79 for ; Thu, 13 Jan 2022 02:46:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 82DD268B9A5; Thu, 13 Jan 2022 04:07:42 +0200 (EET) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B453A68B97C for ; Thu, 13 Jan 2022 04:07:38 +0200 (EET) Received: by mail-qv1-f52.google.com with SMTP id hu2so5109513qvb.8 for ; Wed, 12 Jan 2022 18:07:38 -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=Mi74kOYexCds7ZrxKSDYjsa2O2N6lC6rpnhswo7R6HU=; b=giTPeHIcSfCwx0Vj5W21UPO8+OR7/CrFV178F8uNpxk3WZF3//iX9Cq8/79dHPQB+i FJGjISnbJ+zrtpt+fc66UExcox0kyGjcBGLMrAxm1WliFbUU1fdWSTmjeAqeJzT1tHZb EGNascP7HHsNM9bwqbLiEByc7DTqR4XHC08vE+aAbL7MrtivckC+KAxiCTJKkz355h1i 7Oj5B2wHKl1VxYtzZKKa9fVCMxAF4EBJ71L9X4Zk/3CDyW9MFC2/0KbKVZyrN6Kjbhv9 1NgexHWtpVPGL1MrcJNON1IqhGvK6D6GPCZvsAXDVJzkZhYZ4hJlPR+l3lKfjh7I0kUA L+pg== 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=Mi74kOYexCds7ZrxKSDYjsa2O2N6lC6rpnhswo7R6HU=; b=BTBCtDUrJW8tNL+YkzJBvI6fu+7lCNXB4QaZl+i55KOMUMg5v3Dtfkk94HhZeCZwQP Ua+DQGR40rq+e865fF+o+KT4q9bPYdGM13W2TbacxYm5djvG2BfTFQi97PUXMpX4GDNz cS2Km0lDmv4XsgTiMAGVww4cbemZrVUw/yFuMoQ4LZkZxp4aS/sPsb3uTjIRMifsEP6N laFODfIFpS+/rGkYn2swC2xOSG+1P0iEW6Ns48X+4K8D1caGhSOjbsCqgNMqz5LpW8Lp WLgzw/uX3HeG8R77eBzl1eLHJM/EA/mKMxFuuX/+vi5POZoa2Qvc5I0OlpsFjf8suX6P /QkQ== X-Gm-Message-State: AOAM5315toZtIKY4U64vDn1zTjPToS6Ptr8qy8QOQeMFK8Qed1Nt7Jgq EdDaLqxdc1j6FRROYE5jfij2EKDI/Ps= X-Google-Smtp-Source: ABdhPJx1ZS360OSBvkPTtgek7kpaS6SRxj88UzHIvFURQxpMLNiYXpH41xrJR9kPWmICQucS8wzFEA== X-Received: by 2002:a05:6214:262e:: with SMTP id gv14mr2305338qvb.5.1642039657088; Wed, 12 Jan 2022 18:07:37 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id a16sm1085946qta.13.2022.01.12.18.07.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:07:36 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:06:52 -0300 Message-Id: <20220113020713.801-9-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 248/281] qdmc: 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Anton Khirnov Signed-off-by: James Almer --- libavcodec/qdmc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index ae75ca524a..dfdd84870c 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -245,13 +245,14 @@ static av_cold int qdmc_decode_init(AVCodecContext *avctx) } bytestream2_skipu(&b, 4); - avctx->channels = s->nb_channels = bytestream2_get_be32u(&b); + s->nb_channels = bytestream2_get_be32u(&b); if (s->nb_channels <= 0 || s->nb_channels > 2) { av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n"); return AVERROR_INVALIDDATA; } - avctx->channel_layout = avctx->channels == 2 ? AV_CH_LAYOUT_STEREO : - AV_CH_LAYOUT_MONO; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = s->nb_channels == 2 ? (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO : + (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; avctx->sample_rate = bytestream2_get_be32u(&b); avctx->bit_rate = bytestream2_get_be32u(&b); @@ -277,7 +278,7 @@ static av_cold int qdmc_decode_init(AVCodecContext *avctx) s->frame_size = 1 << s->frame_bits; s->subframe_size = s->frame_size >> 5; - if (avctx->channels == 2) + if (avctx->ch_layout.nb_channels == 2) x = 3 * x / 2; s->band_index = noise_bands_selector[FFMIN(6, llrint(floor(avctx->bit_rate * 3.0 / (double)x + 0.5)))]; -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".