From patchwork Thu Jan 13 01:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33317 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp15058iog; Wed, 12 Jan 2022 17:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3XTa+41ziDZkMf2elybr0oC21Ny2mKO+QilHsG/5CaXrRYt0qrxwMeem57CRlj0sgF59e X-Received: by 2002:a17:906:f02:: with SMTP id z2mr1896056eji.499.1642039045182; Wed, 12 Jan 2022 17:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039045; cv=none; d=google.com; s=arc-20160816; b=hGKSTANzZ3U3LgQ4Mstjrx3/usMXpB8CRtlcbahp/BOMAmo5MZ/ouUziobeG8v+o1I dmou7oMEgHbqcj0+2085wcNc1cdtXWBvBntv9ZmgDNM2UBtobUYNGIBjXCb8n/AYk9EK mFaqgBlcnDkux1JTaDYF9zI9cDKNWM69aNvJhaluFq2NzzZ+vsCjhCmT824wKdD/pbAP HcYAfjNSpj2x6sk7WxHPb7Cmi9t8wjQeJ+rrqMlBRVut208AlU1KF6+M09IDrJt5JFxi mZlp6FgxFGv0f3TEreMsNYVZHDPEL5sh08LWwXJkdWufRzRxVd2LdBstISigeWGHAWNv LNhQ== 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=Mis8/pgSoKfDL7zglQdWBlF+/CqkctpHzHn6QtVKxmE=; b=QGzkYhw84BK7FYO7rDn6VFyYMxN6OkaYhAI2chpyAzP61e16QyhWzADXHPXlrDfMYm vQ98IeHZgm/Xmq4e7utRO+d9zhtJ/NnJUxUxSly2Q2UA5X4wCaTUcMwMphwmpe7hANaJ xVL11V23wW0gxk/OxpRWwVwcM6GkoE1EGNV4EWnHnkekwzdVjy6DrxudgOgfmm/rohvU zR1ClsqmLQilvlGLcX+EWpNhDwn/PEZ1XYkmSsBzlvGlJDwFlPLJG6HU2RNKcOp20bC8 LalA2pDCiVG2zheTIxybnXhJSlnqGwAkX3tlRjAw22smsuNXPVWkshfM+J8bG0lCZamv XJDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b="E6/qL/Wo"; 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 qf22si838636ejc.560.2022.01.12.17.57.24; Wed, 12 Jan 2022 17:57:25 -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="E6/qL/Wo"; 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 4AD9668B002; Thu, 13 Jan 2022 03:52:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0299B68B009 for ; Thu, 13 Jan 2022 03:52:33 +0200 (EET) Received: by mail-qv1-f50.google.com with SMTP id p12so5080070qvj.6 for ; Wed, 12 Jan 2022 17:52:33 -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=JdwTrbJCoWPA+C5WLbhXRURovMXWRXGUUGya+Bt4Z+g=; b=E6/qL/WozUGQVAop6tKy6xWmh+XzwbIH8OWkjtzVTFnQIxenAnVsCSDnIwpmdP5oUA /QEveKljxlX+OlHGcqfd0nHEGTFDEMu/N+q/OT01lOh7u6piJTHehk1lsKiuyzErRKtz KISNNbGmnYFfO06IbQ0f+J+3AIOjZQlcBzsZ1xDvsZ6R+RcAD9IG8bkrwB2YhDvfRX0D ZiUGyoaZh58RV2/z7JVnahdojYYSU0G34+rxU3AmntYX+L81u563an8fNXKaoul5Rj9Q qEaw5oT3DCcNIS8FQdKJ9HEF4h4fdeC0C/uxgqW2sp2MURgF2F2gc/V/0aJnnLUOD2VO sn6w== 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=JdwTrbJCoWPA+C5WLbhXRURovMXWRXGUUGya+Bt4Z+g=; b=jY4mkc70WcBh8g4EATHLVVGoXVGHAnAqNv1hDKWjw0aVjNgfJh7QyrhBZ5EgbB+qxk e3coiyzt4mLb+jGlZ6x0TMXnL8Pi4zXX2UkR7zlR74ZdCvZOVs26RrIT5GAql2rHo9X2 +tU7zU+uxtH0Ks+RTdzwGlYAIyKRrNJo9eQJiizGsLzySxTxWqzM192nuFqSdPF6sq0E Nb1hTmahuFT8THtrYW1FLsxupsb0ZTvHgcET2yIgKY7cMD11+Huokl4skeaM4c+ItS6k GFl5k90u6MT/lGG7BnbPp2FNhLdGElnCPZMP+6wqsLzs+PwTLCUqI3eUEzUch+k8fGzt SJGw== X-Gm-Message-State: AOAM531kZjJFU2MnhbVw/L9dcYxJNvvcHB5Xz26sJr6Mbom6FlloCPi1 OvGPFwnM67ccbcN3k5F/YrRbOwj/MP4= X-Received: by 2002:ad4:5964:: with SMTP id eq4mr2248526qvb.109.1642038752583; Wed, 12 Jan 2022 17:52:32 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:32 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:49:49 -0300 Message-Id: <20220113015101.4-28-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 027/281] apc: 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: Q+Z+aeuRkpM5 From: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/apc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libavformat/apc.c b/libavformat/apc.c index 56151bb59a..192e115278 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -38,6 +38,7 @@ static int apc_read_header(AVFormatContext *s) AVIOContext *pb = s->pb; AVStream *st; int ret; + int channels; avio_rl32(pb); /* CRYO */ avio_rl32(pb); /* _APC */ @@ -57,16 +58,11 @@ static int apc_read_header(AVFormatContext *s) if ((ret = ff_get_extradata(s, st->codecpar, pb, 2 * 4)) < 0) return ret; - if (avio_rl32(pb)) { - st->codecpar->channels = 2; - st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; - } else { - st->codecpar->channels = 1; - st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; - } + channels = avio_rl32(pb) + 1; + av_channel_layout_default(&st->codecpar->ch_layout, channels); st->codecpar->bits_per_coded_sample = 4; - st->codecpar->bit_rate = (int64_t)st->codecpar->bits_per_coded_sample * st->codecpar->channels + st->codecpar->bit_rate = (int64_t)st->codecpar->bits_per_coded_sample * channels * st->codecpar->sample_rate; st->codecpar->block_align = 1;