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 E935C42C7F for ; Thu, 13 Jan 2022 01:56:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2FE6368AEC8; Thu, 13 Jan 2022 03:52:34 +0200 (EET) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8471C68AFFD for ; Thu, 13 Jan 2022 03:52:31 +0200 (EET) Received: by mail-qv1-f47.google.com with SMTP id iw1so5144455qvb.1 for ; Wed, 12 Jan 2022 17:52:31 -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=6VGhvilJOYQewYwHL5CLSGMnkWrL2cRR+5o2nKeW/6A=; b=lfSL3ine+LyWrOZv7BtZfkYDKQkhhEi5kb06mXEZl3fmDGFIC/AMJiksGeVRtbwjuS yrEvTSfr1/9E3hWg8Zk7A3MVJPBODO0m/mlUDIgMl+Z4y/6Gi0YqzEWsgdZJdNTgoXy8 v2LbAZYhGmHdPrrrPPkeGG9eye8xd1DMr9/za+mFss6oJC7V/qVgRbybcIyODEvqlzZF YS7JbXb1luptLKQW9zBZ4jYQ4+pXo7T2PngpJ87m2sBqAJGfWOAirawb12uu5BbexrCs qJ1ZOQKTtoNQ5QA1rJxQgSc8acIqa8H6V810wyiEf0RyBGnIDoCNsb8B1LFqdcsSS/+J MiUA== 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=6VGhvilJOYQewYwHL5CLSGMnkWrL2cRR+5o2nKeW/6A=; b=c7gFNt1+3rqwgxDdA3rpIaofg6XhpyBWA05v2I5xj7MJDQOWViW4BxDsKOAmbiu1Qo GpFI+Q5tgYTPzd6wb17oZ+vYZH8wB/0uMd6hOqEqSBjtHvcu5cPNa5h3+Wu09N2+ldUx V0zPDKHWeiLKqE4w6ZC425zLnzI7SthH8hMPOHMLymvOkCXAIGQFQOEdFOP9Bjw5FXHV WX5SAp8BYuAb7Sff+ttoK+ZZjo79f7I+YMu3P86HG+bwk31wAOAwftWf9jwGTWj/kVLi lhSOiPkK5PDiN3Zo52IOU504E4Our0KklQ03alfECA0Owx2qOVuq0Zp1LiLnzkPXiAzl wg9g== X-Gm-Message-State: AOAM533ZMmGafvvDhE2WvNgJ+PiOmPUF/Ew6ewatAMtbKWPRexTMYoQQ 6s2UzKrF14xvfnHi9eNvH4EzVh7ct+E= X-Google-Smtp-Source: ABdhPJw7Bn6J58xSia5PgbwcNEjrc/d5gq7VG4lD97LIe79M2kNcQY4Qre/fizhnWVgIDjRXzGBywA== X-Received: by 2002:a05:6214:29c3:: with SMTP id gh3mr2430969qvb.112.1642038750127; Wed, 12 Jan 2022 17:52:30 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:29 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:49:47 -0300 Message-Id: <20220113015101.4-26-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 025/281] amr: 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: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: Anton Khirnov Signed-off-by: James Almer --- libavformat/amr.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libavformat/amr.c b/libavformat/amr.c index bc22c2f84f..91322976ec 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -100,33 +100,33 @@ static int amr_read_header(AVFormatContext *s) st->codecpar->codec_tag = MKTAG('s', 'a', 'm', 'r'); st->codecpar->codec_id = AV_CODEC_ID_AMR_NB; st->codecpar->sample_rate = 8000; - st->codecpar->channels = 1; - st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; + st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; back = read - sizeof(AMR_header); } else if (!memcmp(header, AMRWB_header, sizeof(AMRWB_header))) { st->codecpar->codec_tag = MKTAG('s', 'a', 'w', 'b'); st->codecpar->codec_id = AV_CODEC_ID_AMR_WB; st->codecpar->sample_rate = 16000; - st->codecpar->channels = 1; - st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; + st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; back = read - sizeof(AMRWB_header); } else if (!memcmp(header, AMRMC_header, sizeof(AMRMC_header))) { st->codecpar->codec_tag = MKTAG('s', 'a', 'm', 'r'); st->codecpar->codec_id = AV_CODEC_ID_AMR_NB; st->codecpar->sample_rate = 8000; - st->codecpar->channels = AV_RL32(header + 12); + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = AV_RL32(header + 12); back = read - 4 - sizeof(AMRMC_header); } else if (!memcmp(header, AMRWBMC_header, sizeof(AMRWBMC_header))) { st->codecpar->codec_tag = MKTAG('s', 'a', 'w', 'b'); st->codecpar->codec_id = AV_CODEC_ID_AMR_WB; st->codecpar->sample_rate = 16000; - st->codecpar->channels = AV_RL32(header + 15); + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = AV_RL32(header + 15); back = read - 4 - sizeof(AMRWBMC_header); } else { return AVERROR_INVALIDDATA; } - if (st->codecpar->channels < 1) + if (st->codecpar->ch_layout.nb_channels < 1) return AVERROR_INVALIDDATA; st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; @@ -188,8 +188,7 @@ static int amrnb_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codecpar->codec_id = AV_CODEC_ID_AMR_NB; st->codecpar->sample_rate = 8000; - st->codecpar->channels = 1; - st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; + st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW; avpriv_set_pts_info(st, 64, 1, 8000); @@ -246,8 +245,7 @@ static int amrwb_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codecpar->codec_id = AV_CODEC_ID_AMR_WB; st->codecpar->sample_rate = 16000; - st->codecpar->channels = 1; - st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; + st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW; avpriv_set_pts_info(st, 64, 1, 16000); -- 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".