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 E6B4A44A7D for ; Mon, 31 Oct 2022 21:19:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6B0B68BE45; Mon, 31 Oct 2022 23:19:00 +0200 (EET) Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7E29068BE18 for ; Mon, 31 Oct 2022 23:18:53 +0200 (EET) Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-12c8312131fso14873511fac.4 for ; Mon, 31 Oct 2022 14:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Iqv48OuIziSuYbZY0Et80woXPZA4vE3HI7lt6oYyb9E=; b=HI2h+5fW2gBAW7YO9NCgMa3L9exo9SpggEVwmbVBFnBZ9tYrbZ+SpiReIUJvqk4zJz MIWwPC0gOSfgzwj114uV7vN+yjl4qR70L2a3b2IQBZaI/By5d0OVy5niuGXfnGaLJees zowEy82Njmu8p/ANga/bMYsYziNnxM6B44UldEPoy7crKbUfo5zyj8s9mep4dxrBfWBl roW0bqTX/nazwkbJLNSeIyIdCfiogzmsn9q/JNINyGZMA7MveAnwHCSTP4jATbF0Ry+c /3y3NGf3xpg7EWQAG8VhtdguYneWO/vZhZ1ZY5S/1NMMnd12Tr1omntm7iGVcm1P3Alr v0OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iqv48OuIziSuYbZY0Et80woXPZA4vE3HI7lt6oYyb9E=; b=V6NWw7nw23OqgvocLFUgQsZdMHtjM9NMv8M50F8y8Bl8JrWU4j22jWG5h7KQe/ZSgl EhSMyTWZqXTXww2ovvMJanW+NfWKUgIr/VTSIqg/vpItOQOMaU+PNmncoZBz2D5kamZb JYRBfzBRnGPFHuMfjVA4t3ICbDqff/g/kjlCbnWEhXANFzTDnOGCw3+UU3/s1aDWe9XS tXaZeGWYCNRVxnnq5nf5yL2444xE0PLVsqG/5d1YLjvpLVBoG49VjtM6BYRRzsEIZH+S 7aFEV9fRVbulKgrithvXjOg4M7qNRzsBwX20JsjdNwKL1H6sGvpJYh0ACl4uPg8qA67S weXw== X-Gm-Message-State: ACrzQf3eJMKu+oC6R2SkR64CHw88RVMFX18Xy5AxLmhSSg0PIk/Hr5bD DfttdU3kTIWZ2w8HXQtcndByEKx4sOs= X-Google-Smtp-Source: AMsMyM4r0YCaWw+DgrD1JywOHucjZyL/4c5uLfEEPDS1RB6qN7njh+krqEPMGcPnWo3jic4NeenzQw== X-Received: by 2002:a05:6870:c888:b0:12c:7f3b:d67d with SMTP id er8-20020a056870c88800b0012c7f3bd67dmr9016205oab.229.1667251132035; Mon, 31 Oct 2022 14:18:52 -0700 (PDT) Received: from localhost.localdomain ([191.97.187.183]) by smtp.gmail.com with ESMTPSA id x26-20020a9d629a000000b006619dd066fbsm3183892otk.5.2022.10.31.14.18.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 14:18:51 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Oct 2022 18:18:31 -0300 Message-Id: <20221031211832.8213-3-jamrial@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221031211554.8176-1-jamrial@gmail.com> References: <20221031211554.8176-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] avcodec/aacdec: don't force a layout when a channel position is unknown 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: If PCE defines channels not covered by those in the standard configurations then don't try to come up with some made up layout and just return them in the coded order. Fixes al08_44.mp4 from the conformance suite, now reporting and decoding all 48 channels instead of 10. Signed-off-by: James Almer --- libavcodec/aacdec_template.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 9a85692069..4a88aeae1d 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -325,36 +325,19 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags) AAC_CHANNEL_FRONT, &layout); num_front_channels -= 2; } - while (num_front_channels >= 2) { - i += assign_pair(e2c_vec, layout_map, i, - UINT64_MAX, - UINT64_MAX, - AAC_CHANNEL_FRONT, &layout); - num_front_channels -= 2; - } + if (num_front_channels) + return 0; // Non standard PCE defined layout if (num_side_channels >= 2) { i += assign_pair(e2c_vec, layout_map, i, AV_CH_SIDE_LEFT, AV_CH_SIDE_RIGHT, - AAC_CHANNEL_FRONT, &layout); - num_side_channels -= 2; - } - while (num_side_channels >= 2) { - i += assign_pair(e2c_vec, layout_map, i, - UINT64_MAX, - UINT64_MAX, AAC_CHANNEL_SIDE, &layout); num_side_channels -= 2; } + if (num_side_channels) + return 0; // Non standard PCE defined layout - while (num_back_channels >= 4) { - i += assign_pair(e2c_vec, layout_map, i, - UINT64_MAX, - UINT64_MAX, - AAC_CHANNEL_BACK, &layout); - num_back_channels -= 2; - } if (num_back_channels >= 2) { i += assign_pair(e2c_vec, layout_map, i, AV_CH_BACK_LEFT, @@ -373,6 +356,8 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags) i++; num_back_channels--; } + if (num_back_channels) + return 0; // Non standard PCE defined layout if (i < tags && layout_map[i][2] == AAC_CHANNEL_LFE) { e2c_vec[i] = (struct elem_to_channel) { -- 2.38.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".