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 B792241187 for ; Thu, 12 Jan 2023 22:23:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E406868BC3F; Fri, 13 Jan 2023 00:23:48 +0200 (EET) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 191B06807B3 for ; Fri, 13 Jan 2023 00:23:42 +0200 (EET) Received: by mail-oi1-f176.google.com with SMTP id p133so1116549oig.8 for ; Thu, 12 Jan 2023 14:23:42 -0800 (PST) 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=lcL5B23qmR5pIrHykig5UScdzIgMB4rNsZpo70wEZ1A=; b=iageRq9CrT2zeu/bq33ieRHzGR5wkHOhd+CAjIRJwSpbAjiezy3IRDsX1o+PBAUUCh 9gvR8jZPf5HKS48z/z4kxt0Qa0jIEMab0JHl4HwunkR4swnmhfAhBVvBkABK18GhQTT3 BRJFp+7/NcHai1K1Ac5CcYkw26dYgKNU/u3qsJwLt7TiQS2yibconzWfZHibhklPNSne vH83I+PLZjoWVv9zJ8+uAo2Jh3btxxPzDZyROvEN28OLXP4CZf/8yhSVM7aGX8+/74D8 5sZ4n8TT4uuHUe62y9xDSIMMQRdcAjJGv7NAItirLkMdfQdA8jwZQHTU4U6gGR8lPwy0 BrOg== 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=lcL5B23qmR5pIrHykig5UScdzIgMB4rNsZpo70wEZ1A=; b=y31He+CmKBP3CUrW32E0pQ1fYMcGCch7ctmi39obkIYUErtCGvYEBmMyGTYJSsy6FF u67nnUu1KbrnyRgslizafaDoc0Ahy+4GWEqghQXmsQUmh28k7Q+TFmWzvShYOnaeaYIq 5poF56s2T19kl8pqqNG78YWSSBc1GKDRzUtZFjuevc50wdZBjoNOiRVupL1n+jC0JbJ6 EMdslU5eJmKKgMRspYZJXBTXRY1mLsSr6LHCXFes6lIIAJLvQukwGWlka9i0/ACGXyD1 9pnXXdzlx1gfi0ZTxP/n9stWEDr1DjPQpVI405HjbHZMgiG9hu8OhSFZt2UlkySE/AHe nIaw== X-Gm-Message-State: AFqh2ko1pcrhSHG2zCsBaV7JbKDqhNP18o0K+kz7Q3NQhNJeFbm9zxSS KAcCPC3ptGjzetDd6m3Ks3Vwv/znV7E= X-Google-Smtp-Source: AMrXdXt07wxxQHVDHoge8oaa3yCMGdv+bs2hIooTTBWarHsZdAtfk0lbV6mf+s4sScDVbRAskq8DHA== X-Received: by 2002:a05:6808:1b24:b0:359:a465:42b1 with SMTP id bx36-20020a0568081b2400b00359a46542b1mr38629975oib.1.1673562219764; Thu, 12 Jan 2023 14:23:39 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id t13-20020a9d774d000000b00670523bf1cfsm9786983otl.47.2023.01.12.14.23.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 14:23:39 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 12 Jan 2023 19:23:26 -0300 Message-Id: <20230112222326.22018-2-jamrial@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112222326.22018-1-jamrial@gmail.com> References: <20230112222326.22018-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/ac3dec: export downmix info side data only when no downmix is done by the decoder 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: Same as with Matrix Encoding, add a check to ensure the decoder is not doing a downmix of its own. Signed-off-by: James Almer --- libavcodec/ac3dec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 7a84f3c85d..722a1028b7 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1824,7 +1824,11 @@ skip: return ret; /* AVDownmixInfo */ - if ((downmix_info = av_downmix_info_update_side_data(frame))) { + if (s->channel_mode == (s->output_mode & ~AC3_OUTPUT_LFEON)) { + downmix_info = av_downmix_info_update_side_data(frame); + if (!downmix_info) + return AVERROR(ENOMEM); + switch (s->preferred_downmix) { case AC3_DMIXMOD_LTRT: downmix_info->preferred_downmix_type = AV_DOWNMIX_TYPE_LTRT; @@ -1847,8 +1851,7 @@ skip: downmix_info->lfe_mix_level = gain_levels_lfe[s->lfe_mix_level]; else downmix_info->lfe_mix_level = 0.0; // -inf dB - } else - return AVERROR(ENOMEM); + } *got_frame_ptr = 1; -- 2.39.0 _______________________________________________ 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".