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 DFE9242C7F for ; Thu, 13 Jan 2022 01:55:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EAA0E68AFC7; Thu, 13 Jan 2022 03:52:24 +0200 (EET) Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0899768AFA3 for ; Thu, 13 Jan 2022 03:52:21 +0200 (EET) Received: by mail-qv1-f49.google.com with SMTP id q4so5080585qvh.9 for ; Wed, 12 Jan 2022 17:52:21 -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=FbuyZVzcwKBdj+d55zsoEzEimxIqw0PcLF6MP4+XGZ8=; b=lh1DfLnIWHMTdi4PucsUYBte28blDQTdWV5iBdHlrUZmGsIM8Q3iooAaQEtfRTLzR0 WajizTuIxfVWkGbbLIC15KccheFKzKIv9NZo9nKXt0a3GrFGWcWMpZ/LN5WzKYsPBgtl P4WyKbuawrDjV3qFm2uKUOJTeKFhsYc3m0NsQtbi0Ypn5k+vrUphkXbjePWbZHnmIgNq jwdL2rI0yAykjpoib2HMWR+CYfz1kcR/Df+56qYs7LnG/QV3dP+d4bWhcr0/MwWDHcKD C24yWrZhMfVryzNMhUCadABvFvGB/ODU6OVzRS3gliE6HXDRCP6vbDhTpbfPKh1SKroB K1EA== 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=FbuyZVzcwKBdj+d55zsoEzEimxIqw0PcLF6MP4+XGZ8=; b=Gw30LG+kLKaOqC+hRzYQ6Larrh2lUEaC/puk4fwNaUmI3KgERIYVS7UkOcZZ9g1Szz wjS6AENA1e4YQCfnzeNthBzmFPRE/XCQlyCVIvX73pjgiE0uYnph+2IGGXRJeIuaGvhg tvylXw9Inp9IFZkQ/cjAjvuy1rK3dt+6RiOhV5r18xTLeoKR05y6Fs/yQDWUiG+2LcG8 85Q5omZ3P7xQ6Tr0kBVtm446mZLJhNbeYBeMU8gsNRwTmj182rRbiXd0wPxZdaKcgjDR YMDGwPQ0yPBUmA2XmqH+JuzNH9JqwGOv5qiyI290tvM8dNN/Zaez2Oh4q76TFWHUiINx 1RIw== X-Gm-Message-State: AOAM533pN4TmvVoN1yuRfWncHvhh3WDgtxbuFEP/STvGC1HsyaRFTfNf LNtviTOKNG7kPjXL+eiNCEdSLwNoWUw= X-Google-Smtp-Source: ABdhPJzYI1XmHyG74Ne3PTIBOD5/SLLdbY5IpuxvEODF7LbP2/yDwp0ceVzvzlty0VPiNJK0PJS9Bw== X-Received: by 2002:a05:6214:2588:: with SMTP id fq8mr497037qvb.111.1642038740349; Wed, 12 Jan 2022 17:52:20 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:20 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:49:39 -0300 Message-Id: <20220113015101.4-18-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 017/281] ads: 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 --- libavformat/ads.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/ads.c b/libavformat/ads.c index e7b419ce8d..ee329bb403 100644 --- a/libavformat/ads.c +++ b/libavformat/ads.c @@ -48,11 +48,12 @@ static int ads_read_header(AVFormatContext *s) st->codecpar->sample_rate = avio_rl32(s->pb); if (st->codecpar->sample_rate <= 0) return AVERROR_INVALIDDATA; - st->codecpar->channels = avio_rl32(s->pb); - if (st->codecpar->channels <= 0) + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = avio_rl32(s->pb); + if (st->codecpar->ch_layout.nb_channels <= 0) return AVERROR_INVALIDDATA; align = avio_rl32(s->pb); - if (align <= 0 || align > INT_MAX / st->codecpar->channels) + if (align <= 0 || align > INT_MAX / st->codecpar->ch_layout.nb_channels) return AVERROR_INVALIDDATA; if (codec == 1) @@ -60,11 +61,11 @@ static int ads_read_header(AVFormatContext *s) else st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX; - st->codecpar->block_align = st->codecpar->channels * align; + st->codecpar->block_align = st->codecpar->ch_layout.nb_channels * align; avio_skip(s->pb, 12); size = avio_rl32(s->pb); if (st->codecpar->codec_id == AV_CODEC_ID_ADPCM_PSX && size >= 0x40) - st->duration = (size - 0x40) / 16 / st->codecpar->channels * 28; + st->duration = (size - 0x40) / 16 / st->codecpar->ch_layout.nb_channels * 28; avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); return 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".