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 074E042E86 for ; Thu, 13 Jan 2022 02:31:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3AE368B559; Thu, 13 Jan 2022 04:01:41 +0200 (EET) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7B7B568B51B for ; Thu, 13 Jan 2022 04:01:38 +0200 (EET) Received: by mail-qt1-f180.google.com with SMTP id g21so5214448qtk.4 for ; Wed, 12 Jan 2022 18:01: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=DvmUjYi029Qx+vyxtgxr4EAuorQY5oX99rt1QTGjHCM=; b=V7Pw0H/0Wv2M3E+cE26P3D0ETrEuwlOHrckX1Xt1DM4y+BDDi9ndfIT0Zbo/zuw23X ICwdbPIPzOywSmN8ELpPffbkQ6Bh9UdHkCr5nGAaUzwOrio1qAVQNuzbA/Dv7YSI8DM4 D8qwuNVEyLAzgAqcmsxQE25fEdxQ8HMDaBG9y5sjCdZUecN0XCZfzpAieBHTyMCgI8TC qASa+YJhq8pCFlBoqINEzjiHHN1blpu15q1VzFk1Vs+ndfOG1QGOzIbfufVOwKhexMNC rUID/0lyieFBpmZDYHka8nwbXZKfQiM4DE1iqtyh0uFkqir7wgxTUpE357+ERnzrUDHV 91IA== 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=DvmUjYi029Qx+vyxtgxr4EAuorQY5oX99rt1QTGjHCM=; b=gL4lY/ivRZ7nZqJaV5H+rYIQUfNFQQV0F0siI4GHwjOc2jydCCYSXQFAQ+oaHqr0Pl WAhdeeWm6uQH1MDa5cfBVodCi7QeY/4F+0pnzUt3Z2PlgUKzJUK/zuqZ6HVJge6llqSx heNIe6uwOrJr6+jo7bznb0snHtPAOkepzOqf/74sGLmfjjiSmN3qrYPEjxqnQWPqvikr 3s8YVZ4o3SRxknVS5oarDpbeQEjwPfrugiJQtJcFyuOKgBEeBPI8A7vo6NHDANffUgiS o7c+tKI4GDM6p3fqUcwg7SJVHyTUyZYrR3nDQzpD+FEj5fLdHQvcQ/XVPsMgR85cLG5H y6kQ== X-Gm-Message-State: AOAM532C1xM4loCkTnUMTnYG1ezEiFyq2/jhGkzDEXRYOzvvS7+HvQ0a aGuGpjyhC1O7f30x2wzAWatujBtuW0I= X-Google-Smtp-Source: ABdhPJyq6AlCVg/WlEX++7UK2+APw4w1jEUgsUjZNhA1DYJkfyLQCT4dXZmIzD0j7XqT3qAvOQPzeg== X-Received: by 2002:a05:622a:1741:: with SMTP id l1mr2076675qtk.458.1642039296985; Wed, 12 Jan 2022 18:01:36 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id y17sm1182232qtj.75.2022.01.12.18.01.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:01:36 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:00:21 -0300 Message-Id: <20220113020026.590-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 174/281] xwma: 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: James Almer --- libavformat/xwma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 37ab3a1ec0..c16ff1be63 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s) * 20/48/192kbps are all 20kbps, with the exact same codec data). * Decoder needs correct bitrate to work, so it's normalized here. */ if (st->codecpar->codec_id == AV_CODEC_ID_WMAV2) { - int ch = st->codecpar->channels; + int ch = st->codecpar->ch_layout.nb_channels; int sr = st->codecpar->sample_rate; int br = st->codecpar->bit_rate; @@ -146,9 +146,9 @@ static int xwma_read_header(AVFormatContext *s) } } - if (!st->codecpar->channels) { + if (!av_channel_layout_check(&st->codecpar->ch_layout)) { av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n", - st->codecpar->channels); + st->codecpar->ch_layout.nb_channels); return AVERROR_INVALIDDATA; } if (!st->codecpar->bits_per_coded_sample) { @@ -236,7 +236,7 @@ static int xwma_read_header(AVFormatContext *s) if (dpds_table && dpds_table_size) { int64_t cur_pos; const uint32_t bytes_per_sample - = (st->codecpar->channels * st->codecpar->bits_per_coded_sample) >> 3; + = (st->codecpar->ch_layout.nb_channels * st->codecpar->bits_per_coded_sample) >> 3; /* Estimate the duration from the total number of output bytes. */ const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1]; @@ -244,7 +244,7 @@ static int xwma_read_header(AVFormatContext *s) if (!bytes_per_sample) { av_log(s, AV_LOG_ERROR, "Invalid bits_per_coded_sample %d for %d channels\n", - st->codecpar->bits_per_coded_sample, st->codecpar->channels); + st->codecpar->bits_per_coded_sample, st->codecpar->ch_layout.nb_channels); ret = AVERROR_INVALIDDATA; goto fail; } -- 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".