From patchwork Thu Jan 13 01:50:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33347 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp20483iog; Wed, 12 Jan 2022 18:05:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiuZsgeZGTR9WbF5BNcuxuM1lpqn29dn7yoGsTKfN4ZY0DYZvpaoQQj5f0vSzys6aN6EiN X-Received: by 2002:a17:906:9a2:: with SMTP id q2mr1831078eje.466.1642039528104; Wed, 12 Jan 2022 18:05:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039528; cv=none; d=google.com; s=arc-20160816; b=a8fX+UabDCz2LluM9nFqkIuHOtqJj5L1WHIEcLrma2KgVWn5lEKmmgtv3yHruUOb37 mshHr+AI217jd+mkR2noh1IHqqNkD/rVCYzUXGY4q6XLbsJC/N7QiEF66kd0u/c5teZS 95qw1Ov+SNKqDxaSMH7qsYJnl+QJxP1bE0w66sFdzuDdePzg2pctTI2GhZBwD8T65fdX QzL0FXoGlTJ42csaQcWc/YIOb/aZYhaeYKEAS+8T33rfccN85SBfjWAfhmzU+I3n89c7 IOrKqsLn5Xh/cKYSBvXm6nQmDJGg6AIkAAR422RLu8CgoStZupjX2ci1pETuuO/B6MKU Y4Rg== 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=okSA1kBNughpIF4w7cmi+FdJRzLP7G9toAxNLf5IGss=; b=JzwCE0vKkAJraobVdfKSJjRz1acRcQhHT9SXplDegQIpjtzkq2JtPstK+SjidkDM07 NGueN9GDp+858RHoQcIuiF1UFQtY8+8RpNx/SZVLlq7NqYPnLRZhZBec+h3a0fE4K/qr +hS2Pa1xyR5UWrGiFIk1BPbo0HO0gF4o4CWnAbCBerWTLtQrrkySkku5SgT+fHli2rnK AtOaf9ZbkL44kYo5KnmZx+gRFVFbG3S0234TXtYU9Gmb59GoF6PWYB7z1tfCS9i8d5uN r+gm/8n14Xu9GqFkc7o2m8qlXoZfsaicJCt6xQnKV2OUk3dVLJ8EFLsubsM7Nm49fT1K 0phA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=DDrPfOb7; 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 i19si711873ejp.881.2022.01.12.18.05.27; Wed, 12 Jan 2022 18:05:28 -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=DDrPfOb7; 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 EF06D68B181; Thu, 13 Jan 2022 03:53:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 09E4B68B174 for ; Thu, 13 Jan 2022 03:53:17 +0200 (EET) Received: by mail-qv1-f48.google.com with SMTP id fo11so5071026qvb.4 for ; Wed, 12 Jan 2022 17:53:17 -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=WSKpFqxcUwLPluybIc+WqhJhewWn0zO+5bfvBPYpO8U=; b=DDrPfOb7/bFa/o/4lLg7ab3tlzkt8J0kqojppUDuBhHsv/ogJO65U5+BPTcTY6sisO 4vZek+ZSpTDdbwMNohP1fufHH/1ZRWmmf/c0c3BotLE45RYwxbNBgbdwh5kdUIeCavxz Uo3ECK0nTCG4CksAiExK53mN6c3KRzZZUOuxT1PN8BE+44mr3lA2OwpsJVJ+ghY4hGf6 7Gkl72M9z8M+9FWHbowB9tULaomjMVs5oN50f4S+LAlzP1/ZzZumIy2X093Ewd+3dme2 8ZTOTApJ/WpgTmekmMoaDNvFwgXfsfAmmB/3NDn1Qm3rGucv1zlQzL1Mww6Ci/VXSHrD pwhg== 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=WSKpFqxcUwLPluybIc+WqhJhewWn0zO+5bfvBPYpO8U=; b=IEnzMTC0sLH5DyxN0FGRR7UK5IHY6DXDDw0NrVyxejzzhQIfrCvPyPwjwAOVCTsVMR 5G8CYvF1ZRwsy+0J0KzuOVJxHINCw3rIRbuyO845c8CO/ET5Flp2KA/I1TukwtUdGFus I2Fy3g3m/VOw070Oi9cHgA+Nojq7D389GaLDk3jBrUa7EN8jinkESGLvTMyM4nC72Z9F xcSn+MT0/y8J9WNKDZLptYuO0rYQRPF73P95mFhVZ271sv1TUo4UUXOb4kcb1mpMwp76 zIaxUTui3mBrRY7gBtCxIn6dzj5opvL7p8haGirC5HrFQjidP1QVlHTXymw2tbn6r+YF cw/w== X-Gm-Message-State: AOAM530WSiRXWAfl7xbpRD5Jbe8AtSLYAKdTUxkWE/oI6ANSYalqDrof gPTBPpC1eMgpEW7TFIJEd/1LhXJRGhY= X-Received: by 2002:a05:6214:29c3:: with SMTP id gh3mr2432274qvb.112.1642038796360; Wed, 12 Jan 2022 17:53:16 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.53.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:53:16 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:50:25 -0300 Message-Id: <20220113015101.4-64-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 063/281] fwse: 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: hGKih9bj5rio Signed-off-by: James Almer --- libavformat/fwse.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavformat/fwse.c b/libavformat/fwse.c index ed8cd3a6db..28a322d9d6 100644 --- a/libavformat/fwse.c +++ b/libavformat/fwse.c @@ -40,6 +40,7 @@ static int fwse_probe(const AVProbeData *p) static int fwse_read_header(AVFormatContext *s) { unsigned start_offset, version; + int channels; AVIOContext *pb = s->pb; AVCodecParameters *par; AVStream *st; @@ -59,13 +60,10 @@ static int fwse_read_header(AVFormatContext *s) par->codec_type = AVMEDIA_TYPE_AUDIO; par->codec_id = AV_CODEC_ID_ADPCM_IMA_MTF; par->format = AV_SAMPLE_FMT_S16; - par->channels = avio_rl32(pb); - if (par->channels != 1 && par->channels != 2) + channels = avio_rl32(pb); + if (channels != 1 && channels != 2) return AVERROR_INVALIDDATA; - if (par->channels == 1) - par->channel_layout = AV_CH_LAYOUT_MONO; - else if (par->channels == 2) - par->channel_layout = AV_CH_LAYOUT_STEREO; + av_channel_layout_default(&par->ch_layout, channels); st->duration = avio_rl32(pb); par->sample_rate = avio_rl32(pb); if (par->sample_rate <= 0 || par->sample_rate > INT_MAX)