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 079AD42E32 for ; Thu, 13 Jan 2022 02:30:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B692E68B51B; Thu, 13 Jan 2022 04:01:39 +0200 (EET) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86CBF68B50E for ; Thu, 13 Jan 2022 04:01:36 +0200 (EET) Received: by mail-qt1-f175.google.com with SMTP id f17so5343781qtf.8 for ; Wed, 12 Jan 2022 18:01: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=l7IpLEt3KbNRNJDoJpf8dFPqYCfOK7O+EYqNlEoiarU=; b=IcKm6HnK1z/cpXhuATcZbhRoP43+EiG2QTLYns7dSKvYt0LYxyPh4zhTrYpofU6sLb uwfOJmxWzw98G2vNAtA67B26Owb0RjKuXmElyjWAISYxQoweU4OsDLXKWxkJWb5c2KZJ 0VIhEcVLQOLKwK/nJ/SQrza1vJEeTwUnb0ULjKJQtrIEb/CJzQvEy89Va018QyvhLntT XK1gDLg6Vj3CibWZdW+VQWBcXob7BYKJ8qgbI5Qxf/384Tz3gDHBOAJO12ILETE5MTj4 SIkD8pHO5WsEPBVpM8YCJucKA1Y50+ZyfCoHgpKyNmg/uRdcexQ2A4usLDKv2J8p57Mj 9QvQ== 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=l7IpLEt3KbNRNJDoJpf8dFPqYCfOK7O+EYqNlEoiarU=; b=O/s0SWuIH/4KZ+dDoDz/55Pb1HCF6pjo5Sdo345QxOyn0M7AZ1Iojent34wnJuQFUe 8bP7FKlfz/HQwi3v+Euiiyvqa3kpclx7u02Fo0rQASIp3i568CptXHgNtVa7/L/2GBtq n4ceeHlqGeYPyUnLeWZPJwkSbQ2i8AvkyEIbLIwSJBT2DhwGHqnVOUr8+4GZimbnHYb1 thcvOVpBvcc5jS0/ivZvAqzLFTWD8+Bih89fzzBCPSWiCxGUaX9RGyHSwbBaIAI5GZzQ kMOf53aAv/3jj044TN4VQHek9Jp8sPQeFCIlnaUWTlDYYUeeE/MexkAkJCxywDTRunRP LmKg== X-Gm-Message-State: AOAM5331jUa6iz2lL6czatClnYsGjPDohWusZ3hnHaMkZbc/7vOP7RRq AoUMtCO5Si5d4C2D15zYKpWs+lGyZsw= X-Google-Smtp-Source: ABdhPJzK0XzTLHSuMMGug1TUY8dAf13mu0pujPf/nap+KaxNgk3Kxb2o/GxXV5Exy2XHMfT34NE7zA== X-Received: by 2002:a05:622a:342:: with SMTP id r2mr2063479qtw.240.1642039294541; Wed, 12 Jan 2022 18:01:34 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id y17sm1182232qtj.75.2022.01.12.18.01.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:01:34 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:00:19 -0300 Message-Id: <20220113020026.590-24-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 172/281] xa: 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: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/xa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavformat/xa.c b/libavformat/xa.c index 762e90246a..af99c1f327 100644 --- a/libavformat/xa.c +++ b/libavformat/xa.c @@ -78,16 +78,17 @@ static int xa_read_header(AVFormatContext *s) avio_skip(pb, 4); /* Skip the XA ID */ xa->out_size = avio_rl32(pb); avio_skip(pb, 2); /* Skip the tag */ - st->codecpar->channels = avio_rl16(pb); + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = avio_rl16(pb); st->codecpar->sample_rate = avio_rl32(pb); avio_skip(pb, 4); /* Skip average byte rate */ avio_skip(pb, 2); /* Skip block align */ avio_skip(pb, 2); /* Skip bits-per-sample */ - if (!st->codecpar->channels || !st->codecpar->sample_rate) + if (!st->codecpar->ch_layout.nb_channels || !st->codecpar->sample_rate) return AVERROR_INVALIDDATA; - st->codecpar->bit_rate = av_clip(15LL * st->codecpar->channels * 8 * + st->codecpar->bit_rate = av_clip(15LL * st->codecpar->ch_layout.nb_channels * 8 * st->codecpar->sample_rate / 28, 0, INT_MAX); avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); @@ -108,7 +109,7 @@ static int xa_read_packet(AVFormatContext *s, if (xa->sent_bytes >= xa->out_size) return AVERROR_EOF; /* 1 byte header and 14 bytes worth of samples * number channels per block */ - packet_size = 15*st->codecpar->channels; + packet_size = 15*st->codecpar->ch_layout.nb_channels; ret = av_get_packet(pb, pkt, packet_size); if(ret < 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".