From patchwork Thu Jan 13 01:55:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33371 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp24965iog; Wed, 12 Jan 2022 18:12:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzonG+W4It7hAUtDWDhQ82tUL+J9zznzLTBfY8JOlAXV8HnykbhDSSTCchA5FG9Dw9LkXSk X-Received: by 2002:a05:6402:3585:: with SMTP id y5mr2284342edc.338.1642039922777; Wed, 12 Jan 2022 18:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039922; cv=none; d=google.com; s=arc-20160816; b=FxPpJEIq7kTtwNyg+0r0H5+BtI/9a9C3paVzPO0/Jf2VkCvvnbJPl/czmBov643tv1 OxgEDJUfDgz0qhr6OxYL6V5z7q/sjtDNEUggTZAHscDdalydvaQAvQsO1sj7CFPcwUoW xPkHdT8/K8D6SNpFBfEV2X9DsPo5Jwz+PHe9Rt1DnuKO/gDz3skorzAjV0vrU1P/AsPO Gwiu7zfJb2sOSRxhBGgEiimqoEArOxHTMztFxncZidS6mn59oGD9PYGTL90v6ilY/Ea+ egtBFPGwJE0GQwmjKeP90M3NZ6VGh6guJGfLqojLJtq/2hf5/9NeSX5kcVsaOcmt3hRL izjQ== 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=QFiNr2BMSWNQgukctVmCJ1bZULjPScEY43F+TXqcIiU=; b=XKxxD1KkY/+DDZsS1kOOw0BO+UeAyOyqI9h2ZlsYfZgZ33orR/vEtSB2VTDttGSPu4 JpcCTbJqrH02LI2b/m7Ble19ADS5lGr82zJXQHzSzecLEwmQ0011TWUN3jrhQTWU3EaD DOAgm5mDyW3t42eXAb3/YJyKSuBTiGiK5fXfCU9wzAcnA/hOar5jaYP+0F7Y+AIEDAjW 3EWU55W4V7ff82mS9nALVsTolg+ePwYdd8z+OjzV4mBynVVWUDRsHK9Kc0TIs9Qv2uZa mx6K6QVziFR6QsjWDtZ0qlJjKedyweOWK1SMDDbJwL5J97kalKF/D83zoIE+ZYpUrUi5 mwug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=JkyJ3gs9; 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 er18si991edb.569.2022.01.12.18.12.02; Wed, 12 Jan 2022 18:12:02 -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=JkyJ3gs9; 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 ECF5168B233; Thu, 13 Jan 2022 03:56:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B5E0868B1E5 for ; Thu, 13 Jan 2022 03:56:32 +0200 (EET) Received: by mail-qt1-f182.google.com with SMTP id h15so962614qtx.0 for ; Wed, 12 Jan 2022 17:56:32 -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=L5uwSuv9y7PB6Ome4d+jYDpzRxzMEiWdT924nBYUzsc=; b=JkyJ3gs99Fz0odXKThZGwVqlf103a1+VMmwADvPW8SauVXw4s9/RCcG0zYuKyJiJJh yVbNzXyn+vhx1Adns0Qe9QvU5qr3PEiLyZfGQ04NwMTyYdRP+jF2S3cmAKdKCu2i+AxS 8R5l8XbyGyC9plabs/4VAXArPT32It/lr5z3mUmcRWTUje8GHymw6uOhDh0tXtC2dw2S Y2CMpBMnjYC3vrWxq9anDQsdBsTvuJX8LqkSlixFDfAS0Q2SS8Gvch/9qft6p8+VDtnT x/qUPvb/PI0WCIPuXxtiMh2jIXzor1diRstcL/LZigdxHDLfhIxfUBVgnuygS47v0RAo GUOg== 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=L5uwSuv9y7PB6Ome4d+jYDpzRxzMEiWdT924nBYUzsc=; b=ZMnN47/ObAy73LI/H0DcCCqlZ5OioyJt2mElhkCoFHtdb1eoC1gtj7YJR+RLw7hGVk 6IYoUFP1GfdOty8orYteoi6d9CnNiWEK2IBsPiaOw2TypGJPYqlEwqMcVMvpzLWCfG5B c8VLNPN61ulrPZbtqln70s6V2LV5o7nVQCdfwmMvGskw1Ig4nYnaJZo4mAd5ZEZlXF3z 1YDiQoZo/mOhyTp3Fctxe6CMzHZPwhRkAZXYrR+Xxh430F5Vm0O/sM1FvUqSklsxbEOl NskqaqjtyG4ZGrEJcFZqLU9S/9XEJ6LRXRmooHNWCy66DgmVmzwa49E9P4j8zcJeC0I/ ScGQ== X-Gm-Message-State: AOAM5336zvbJXejuBeljGVyeELw/vf9YglxchxkeInUB46qYXtovTnnM 59oh11+u4x6M40zCxQHIfsgS5oZ9JlQ= X-Received: by 2002:ac8:5446:: with SMTP id d6mr2009548qtq.163.1642038991326; Wed, 12 Jan 2022 17:56:31 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id t11sm906506qkm.77.2022.01.12.17.56.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:56:31 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:55:47 -0300 Message-Id: <20220113015612.448-6-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 094/281] mmf: 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: vmIVHlt9+Xwu From: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: Anton Khirnov Signed-off-by: James Almer --- libavformat/mmf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavformat/mmf.c b/libavformat/mmf.c index 0c067a1025..4c3ef3456b 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -80,7 +80,7 @@ static int mmf_write_header(AVFormatContext *s) return AVERROR(EINVAL); } - mmf->stereo = s->streams[0]->codecpar->channels > 1; + mmf->stereo = s->streams[0]->codecpar->ch_layout.nb_channels > 1; if (mmf->stereo && s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(s, AV_LOG_ERROR, "Yamaha SMAF stereo is experimental, " @@ -261,8 +261,7 @@ static int mmf_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_ADPCM_YAMAHA; st->codecpar->sample_rate = rate; - st->codecpar->channels = (params >> 7) + 1; - st->codecpar->channel_layout = params >> 7 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; + av_channel_layout_default(&st->codecpar->ch_layout, (params >> 7) + 1); st->codecpar->bits_per_coded_sample = 4; st->codecpar->bit_rate = st->codecpar->sample_rate * st->codecpar->bits_per_coded_sample;