From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTP id 91D4642E32
	for <ffmpegdev@gitmailbox.com>; Thu, 13 Jan 2022 02:24:56 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5389C68B08A;
	Thu, 13 Jan 2022 04:00:43 +0200 (EET)
Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com
 [209.85.222.171])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8E34668AFDD
 for <ffmpeg-devel@ffmpeg.org>; Thu, 13 Jan 2022 04:00:36 +0200 (EET)
Received: by mail-qk1-f171.google.com with SMTP id g2so5616786qkp.1
 for <ffmpeg-devel@ffmpeg.org>; Wed, 12 Jan 2022 18:00:36 -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=RO7ivYUBA37qzPKiv7Stf8v06cq9BFU6ztrvZcYiPW4=;
 b=H05cgpAEsqp0yYaOMIUVX7UtFWLN201qdWhSZBR+xCv5JpHr/ihaOIbw3V8Nid4qCg
 HPR0997vNOm4IC6WRCQmnfOcR6Hf3J7OuzxiKtV51r1sQ8c1LqM5c25F542Tustd3nSK
 7YLctpcMLTmsBh8PMIUVuko2BheDWAV2uI+mtbLyCqcoFH94AlCGqDIttqXIYUC4zS5Z
 8sUiO5qGewU7r7ubI0QPo2y9/HmvGGzEvb51lt6E1UwxNy7PRyjbfyZ5a19P1VoiAkho
 3uzeZm4NYeKAZyF1MX8HJV8OQNRZSfjmGG2c7a0J+DjfWfmQmJeQpx0NmQ8mGRWIdvZO
 Tk/A==
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=RO7ivYUBA37qzPKiv7Stf8v06cq9BFU6ztrvZcYiPW4=;
 b=TMjAnrtY/SGLq+HpV3BFhJyS4zqQ6jcH1suOlhlJKaXZXiI72R4d/0PMoVhWPqaJQC
 wXl2GLxtM8I32aXmLCjEqlVR48jb8bJaSXEvPNRJvmKqa1vJjFdXSqmn5kux6iS9DQmX
 gU2xzSl5LO3MIoFYgzQRMtn2IpnSz/u/wwZGY2pr0eY/C9+ViQO/709m/PRJvO6QFCrL
 7XFac6teJGHWmGP8SZdsy4UsXSu8RTiyBtgylMtdVbkZTMh4d7vAQbvF3pBm5+l5Enp1
 O82SVBtSLkHfzv3F8Fa24Upu0iUQgVVSPrD32SqXto+N89aoQ5gfaPv6fK7Zr1v+29OW
 Frag==
X-Gm-Message-State: AOAM532AuF8a0KW7mO3eYwRd4S/8zR3VbbWmkeSqiSj+90Z0NOUuyTyz
 wCxn7LdJavR5mQif8uT0/jCLiblvv9c=
X-Google-Smtp-Source: ABdhPJyjMbvckyZd8GE3QVgmS2GrORY0MqKmMMpoS4b7pXBlsnd9mosapvOtVOvvYKyOXYSfQrs/Og==
X-Received: by 2002:ac8:7607:: with SMTP id t7mr2015740qtq.286.1642038789850; 
 Wed, 12 Jan 2022 17:53:09 -0800 (PST)
Received: from localhost.localdomain ([186.136.131.95])
 by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.53.08
 for <ffmpeg-devel@ffmpeg.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Jan 2022 17:53:09 -0800 (PST)
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Date: Wed, 12 Jan 2022 22:50:20 -0300
Message-Id: <20220113015101.4-59-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 058/281] flac: 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 <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20220113015101.4-59-jamrial@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/flacdec.c | 3 +--
 libavformat/flacenc.c | 7 +++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index 3401aebe8d..bfae5a2af1 100644
--- a/libavformat/flacdec.c
+++ b/libavformat/flacdec.c
@@ -191,8 +191,7 @@ static int flac_read_header(AVFormatContext *s)
                         av_log(s, AV_LOG_WARNING,
                                "Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK\n");
                     } else {
-                        st->codecpar->channel_layout = mask;
-                        st->codecpar->channels       = av_get_channel_layout_nb_channels(mask);
+                        av_channel_layout_from_mask(&st->codecpar->ch_layout, mask);
                         av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", NULL, 0);
                     }
                 }
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index b267197ccc..eaaf774f9e 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -238,9 +238,8 @@ static int flac_init(struct AVFormatContext *s)
     }
 
     /* add the channel layout tag */
-    if (par->channel_layout &&
-        !(par->channel_layout & ~0x3ffffULL) &&
-        !ff_flac_is_native_layout(par->channel_layout)) {
+    if (!av_channel_layout_subset(&par->ch_layout, ~0x3ffffULL) &&
+        !ff_flac_is_native_layout(par->ch_layout.u.mask)) {
         AVDictionaryEntry *chmask = av_dict_get(s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK",
                                                 NULL, 0);
 
@@ -249,7 +248,7 @@ static int flac_init(struct AVFormatContext *s)
                    "already present, this muxer will not overwrite it.\n");
         } else {
             uint8_t buf[32];
-            snprintf(buf, sizeof(buf), "0x%"PRIx64, par->channel_layout);
+            snprintf(buf, sizeof(buf), "0x%"PRIx64, par->ch_layout.u.mask);
             av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
         }
     }
-- 
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".