From patchwork Thu Jan 13 01:50:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33331 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp17640iog; Wed, 12 Jan 2022 18:01:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwq1e+28g9zrTF/N1FOhIQ9JMKhmB7eVtI6cHcms+KSqUXo8yMUPWySkCE2QMRpjnjWewal X-Received: by 2002:a17:907:6290:: with SMTP id nd16mr1832365ejc.244.1642039297629; Wed, 12 Jan 2022 18:01:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039297; cv=none; d=google.com; s=arc-20160816; b=UUv3itxyzXNgBa1pt53COUXX3jLBhKLdncUNzuOEzDS/YTtiDZSnp7Kr9jvVNWN7Ze IODI1BtC2/P+4pQNFhkXU2j267cr4WBsOZhdW3us8DPFcY8D+Lx+Q+3OUF/B8/svPdP+ cbFPBqDKRVsTS7wMcos8n59sDFQO/mMoAsG/7v9e2qbd5itQqb2rhElHsnj5vUlS/4Iu zu7DrCb2f5hN3fy/gqPyyNrG5QH6dcKGXLXs5aJJOoUkKIjD3n+HVLqt8ecjdP8fkqka t1JJ5vSqkHdaGxD26NfIQb1DZfdXeF57BllgLBMRxEAK/agjDXVG1yAEK1cz0dwtDOBZ WpIg== 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=aPmtnKBaQuGJgKP0F97lDgx4f9GpvRemPr5cLzn84lM=; b=fKUPnZ62WK9eRs9byPLrDkpk1X2jXUeC2Pq32zilF/cceoh03kzXDvmAchP9Sqs5UG dkdJxz7MMYK+6GKeM6cA8thNNn/MO/C7wHUnwTohZihvVhMn84+91tHGTNS7rAroqU+P TSeTwtyx51V7NwqeNs1DOWnwbksW0W4fp/5LDNwZSYT/ieXRz8OMIzBzzfDkMdn/NXan EKS33vVYJFahtdIPlNrUwjxOJFk7/QatFiZfhFypiltuRhTZhDiExn+WCSNMzvnEprND cWicG9nh1RQ08s2rIAEZwWsbDcXbeNj15nb9ZNo3SAtphQZa9YvHgJXZzxziovuzOaJv jvmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b="g04v/kXf"; 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 hq18si819142ejc.193.2022.01.12.18.01.37; Wed, 12 Jan 2022 18:01: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="g04v/kXf"; 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 BD46E68B0C0; Thu, 13 Jan 2022 03:53:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3806568B0A6 for ; Thu, 13 Jan 2022 03:52:53 +0200 (EET) Received: by mail-qv1-f54.google.com with SMTP id l13so3581066qvz.10 for ; Wed, 12 Jan 2022 17:52:53 -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=Jr8/1Fj8pyX3LDeFg7AtlNGHH/zb4kUoFB0JMUelvzU=; b=g04v/kXf4ja48wrpPqpSkA45iU9piIc1YFn731IJKygDtjrepRehubiDzignlOTHGV 8BzXuEM5HyCaGK3LRJNtPzS3DOJngp592HkOi5idDXEBbRViwbok3uUy4O7GN1nr7CK+ 8lzu6ceq4uP5xp7U4fkxC/ol1xB5L6ONbkPQeqvP38zzp0PaTf2kvja3uO3CUSNRR+zd Sm/X1BO4RPX+YVHzhzqOr93xY2Ei1kyjMKlhkx6w83Wv/sDCNw58jAOobRgTjhlJm/tK a5upPI3aMTrRF4F9o3goo0OPkD2NTatWfFJYcqqc/V6RB5Lev4GhEpsFG5N57tJ7K9ER coPQ== 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=Jr8/1Fj8pyX3LDeFg7AtlNGHH/zb4kUoFB0JMUelvzU=; b=FaKBRuEs+pTwSZQ1yhD59n1RM504bbU2b2bHiabX2I/UK/LX3PdVcJMN+ZoSwIFr75 cxTwlU6epbpw/qO9T1RvHoGoTWsGZlRGrYiLJzJLYnY6R+5Khd3MJ63wDehl8jV0yskk FsMJjoiyu5JOGjKm8ap4BtVPk9YNrm8HFHyavWi+oRTXoHU31Xjo53HC5FV2H5AQo7d6 dHbnnblS/MzSF888MluqZ3IcEzzOCBv2LLyWA7ET2pKWL81StIWm6dwKadxFLEeuoOSe GHtD8r9+lVmy5Fq8S7lNk7gj1OgP/V3B6/h/SXSmGxpQxhdIDacSNOV/d8m3je9w2Y0d 0HWA== X-Gm-Message-State: AOAM531Eh2fZe5cOOcBxLpAFdSfUvCPglAWQcxoi/xqfdYsSbG3ZXcZV z7nPyFrW8Uk/RrLrke9driVzDJofC9M= X-Received: by 2002:ad4:5964:: with SMTP id eq4mr2249095qvb.109.1642038771901; Wed, 12 Jan 2022 17:52:51 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:51 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:50:05 -0300 Message-Id: <20220113015101.4-44-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 043/281] cdxl: 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: m7fn6TRurpo2 From: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/cdxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/cdxl.c b/libavformat/cdxl.c index c42e0d3545..76dc1d18c9 100644 --- a/libavformat/cdxl.c +++ b/libavformat/cdxl.c @@ -171,6 +171,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt) if (cdxl->read_chunk && audio_size) { if (cdxl->audio_stream_index == -1) { + int channels = !!(cdxl->header[1] & 0x10) + 1; AVStream *st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); @@ -178,8 +179,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_tag = 0; st->codecpar->codec_id = AV_CODEC_ID_PCM_S8_PLANAR; - st->codecpar->channels = channels; - st->codecpar->channel_layout = channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; + av_channel_layout_default(&st->codecpar->ch_layout, channels); st->codecpar->sample_rate= cdxl->srate; st->start_time = 0; cdxl->audio_stream_index = st->index;