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 5598B42D6E for ; Thu, 13 Jan 2022 02:19:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD76168B360; Thu, 13 Jan 2022 03:58:42 +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 516BF68B34A for ; Thu, 13 Jan 2022 03:58:38 +0200 (EET) Received: by mail-qt1-f175.google.com with SMTP id q14so5313504qtx.10 for ; Wed, 12 Jan 2022 17:58: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=YsiZzL1rDvC/9GVKi6Wxz74srtaqJAKUx3by+i0FD7s=; b=WOIkBw5mbzxqRHY3ajZ+xz3VHJNvdChdnXMZANQo5Q357xv2XqVEidrNg7tUl8cXM5 feA6Sv6Z/tdZspSwLiew7a83G7nNYgmkAF7otNr+K4uGVqiV3CGe9ixhPG2gVyOQPEYN 3kEUOVZLtLcw7a/txQnExQ5f93fqbtSgANRzCzLTh86raUYEMrIn5ri8pcsHzBG3SFcF YX02vq2PnX1vNQUUHKeOx+4KYRLLLfboVwYkh35tECP63s8p/2OESJTTN1nKMBRPg1tk N5oGLtXt4t0q76tnF/1QhnSc0rPSgdMmUk7xiGb0iiXVvHfYS3i7ryl6QU6f0oTiZuoG oeBg== 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=YsiZzL1rDvC/9GVKi6Wxz74srtaqJAKUx3by+i0FD7s=; b=FAG/0UaurkdobrjR9owA6Q3x607/ZKPoij18Olwlw+UrpHKaGVHeFmwGR9y0tmrml8 WupP83x2mqvOkduv575TS6gy6U1j2WZtmekcqM7k5aWJqL6rA8E53vKPBRI7pdA1C4q8 4fO4i3qC/641JiP89BjNDEg6FGyS2xjU+PZ9ZNiYMBJiAuXikSt4TLVBtvVPG97n6TNd I0aPdRi9RjUQjYMOzG8VSLn6wlZWohMNO/mDyxFat1UPSGi00QV+FkXtFX53UKeCi+pn pcxSMQyzyTWP/gaASLAzf7/G/7F0C+gd0KKo6vHdoGmsbftsJdsAFPZcgf0+L1CjImq3 A/9g== X-Gm-Message-State: AOAM532vGWCs6k69ceZcOZJTrzUOhZDfzkORE2ex87xaJhrC3E+xh33c rk3w0fJ8jMKPp+Mw5Pr+/eS/ocYr8A0= X-Google-Smtp-Source: ABdhPJxRG8W00KJ/e8KTNTqfGifKy1pCLhQpEtjRsmLThF8F3K3Q3uTEOUb52ROo098KXZ5JTSW8SA== X-Received: by 2002:ac8:7d08:: with SMTP id g8mr1951330qtb.443.1642039116921; Wed, 12 Jan 2022 17:58:36 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id u19sm893081qke.1.2022.01.12.17.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:58:36 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:57:45 -0300 Message-Id: <20220113015806.519-10-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 128/281] redspark: 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/redspark.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavformat/redspark.c b/libavformat/redspark.c index eca182c3a7..f4386d7759 100644 --- a/libavformat/redspark.c +++ b/libavformat/redspark.c @@ -97,26 +97,27 @@ static int redspark_read_header(AVFormatContext *s) st->duration = bytestream2_get_be32u(&gbc) * 14; redspark->samples_count = 0; bytestream2_skipu(&gbc, 10); - par->channels = bytestream2_get_byteu(&gbc); - if (!par->channels) { + par->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + par->ch_layout.nb_channels = bytestream2_get_byteu(&gbc); + if (!par->ch_layout.nb_channels) { return AVERROR_INVALIDDATA; } - coef_off = 0x54 + par->channels * 8; + coef_off = 0x54 + par->ch_layout.nb_channels * 8; if (bytestream2_get_byteu(&gbc)) // Loop flag coef_off += 16; - if (coef_off + par->channels * (32 + 14) > HEADER_SIZE) { + if (coef_off + par->ch_layout.nb_channels * (32 + 14) > HEADER_SIZE) { return AVERROR_INVALIDDATA; } - if (ff_alloc_extradata(par, 32 * par->channels)) { + if (ff_alloc_extradata(par, 32 * par->ch_layout.nb_channels)) { return AVERROR_INVALIDDATA; } /* Get the ADPCM table */ bytestream2_seek(&gbc, coef_off, SEEK_SET); - for (i = 0; i < par->channels; i++) { + for (i = 0; i < par->ch_layout.nb_channels; i++) { if (bytestream2_get_bufferu(&gbc, par->extradata + i * 32, 32) != 32) { return AVERROR_INVALIDDATA; } @@ -132,7 +133,7 @@ static int redspark_read_packet(AVFormatContext *s, AVPacket *pkt) { AVCodecParameters *par = s->streams[0]->codecpar; RedSparkContext *redspark = s->priv_data; - uint32_t size = 8 * par->channels; + uint32_t size = 8 * par->ch_layout.nb_channels; int ret; if (avio_feof(s->pb) || redspark->samples_count == s->streams[0]->duration) -- 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".