From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTP id B5DCF49C63
	for <ffmpegdev@gitmailbox.com>; Thu,  4 Apr 2024 16:53:13 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3C2B68D11E;
	Thu,  4 Apr 2024 19:53:10 +0300 (EEST)
Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com
 [209.85.215.171])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ECA4768D065
 for <ffmpeg-devel@ffmpeg.org>; Thu,  4 Apr 2024 19:53:03 +0300 (EEST)
Received: by mail-pg1-f171.google.com with SMTP id
 41be03b00d2f7-5ce07cf1e5dso950787a12.2
 for <ffmpeg-devel@ffmpeg.org>; Thu, 04 Apr 2024 09:53:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1712249581; x=1712854381; darn=ffmpeg.org;
 h=content-transfer-encoding:in-reply-to:from:content-language
 :references:to:subject:user-agent:mime-version:date:message-id:from
 :to:cc:subject:date:message-id:reply-to;
 bh=I3ZPrOa567fQ5PmMJjObBh5Mq16VKkVO2ZwEIvLbrFA=;
 b=FZQVMt1a++2RvhB+0a5ur1wQndI4St/RnMOjVN+J+ZStCqimtvErAp3Ecue85x+B4x
 gaQ9YZOzDwt+i4KiCW0w7YrRQnrcxD4Ymw2gTSrO9BWVQxpUNRi6w0/B7Di+ZqQLagXf
 0guZncRRveL8LPWaJO6R3yRsZIEoc7iOJkHfxtbpNj3sMr9anoZ76Nhp2azQDLkCi3nw
 hW7/H1irz1Mx8HEHLMDBN82cKXNr5O6eJ8JitdA0G1LgzL4Y0xTJzYq4Fnc8rJBbHspK
 NweMGyM8n/EACPdnLglFxxv19iPVpvh14gs5Nx+GEQmCD+Hm8bcYsfto81hw9OWloGTm
 HbSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1712249581; x=1712854381;
 h=content-transfer-encoding:in-reply-to:from:content-language
 :references:to:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=I3ZPrOa567fQ5PmMJjObBh5Mq16VKkVO2ZwEIvLbrFA=;
 b=SKphnaNhNpZXGU61UI3deB1Tx4apAxaxA+CuHRua8Wi8nUSIwmB2gCLlhQOucXX8bK
 PzgyRr6GTjJQqIGl/2LXy+oJxygn7icWKMTLDG0ZWV3rSz3qLZn9yMLq6eTdJLk0UU2N
 j+ceBHNgFwUb1/KD87BiWcg4MSkrO43T5oBiutPJUZCqR85cOeFAqpKU1zCII2ojrg+c
 Q1SFWEAuFIdyjpGm1FeCIzOJwWEViM6b21E2b9SDjgox1Nx2+4g8rHhhD2LT3fy1rXGr
 lUrIf/be+IOlu5G9P2cW90aBfPxKDNGUAXzPZIPpw+zmcEr+CWgVXb768xv59zeU9Qb7
 apjA==
X-Gm-Message-State: AOJu0Yyi80vHOmCq5hsasmxoBdYVxKFYq2uBvnYX5i1pVyFQY4vblXOq
 6xsHLfpYbxodbTVbYVD53qL+0VRGEVlSrbylK84rgd4bLwevEYmJmU8Y0kOo
X-Google-Smtp-Source: AGHT+IEUIo1cxO7ND5fPoZHzPq99vxVBYwv29aN3PTGL3Qc6f+PxGook/mz8giPYNbCr/9j9tzQe3w==
X-Received: by 2002:a17:90a:f598:b0:2a2:c85c:d3e4 with SMTP id
 ct24-20020a17090af59800b002a2c85cd3e4mr221465pjb.46.1712249581208; 
 Thu, 04 Apr 2024 09:53:01 -0700 (PDT)
Received: from [192.168.0.15] ([190.194.167.233])
 by smtp.gmail.com with ESMTPSA id
 m6-20020a17090a34c600b0029be7922b32sm1906109pjf.26.2024.04.04.09.52.59
 for <ffmpeg-devel@ffmpeg.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 04 Apr 2024 09:53:00 -0700 (PDT)
Message-ID: <465edc90-cd37-4b58-a00d-d2976ca3c99a@gmail.com>
Date: Thu, 4 Apr 2024 13:53:17 -0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: ffmpeg-devel@ffmpeg.org
References: <20240404162936.4581-1-jamrial@gmail.com>
 <20240404162936.4581-2-jamrial@gmail.com> <Zg7ZKNW8n2qm9uL1@mariano>
Content-Language: en-US
From: James Almer <jamrial@gmail.com>
In-Reply-To: <Zg7ZKNW8n2qm9uL1@mariano>
Subject: Re: [FFmpeg-devel] [PATCH 2/2] avcodec/liblc3enc: don't force
 unspec channel layouts
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/465edc90-cd37-4b58-a00d-d2976ca3c99a@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

On 4/4/2024 1:45 PM, Stefano Sabatini wrote:
> On date Thursday 2024-04-04 13:29:36 -0300, James Almer wrote:
>> We only care about channel count. Layout details will be ignored either way.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavcodec/liblc3enc.c | 8 +++++---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/liblc3enc.c b/libavcodec/liblc3enc.c
>> index 63d1645b10..5f8169a0cf 100644
>> --- a/libavcodec/liblc3enc.c
>> +++ b/libavcodec/liblc3enc.c
>> @@ -61,6 +61,11 @@ static av_cold int liblc3_encode_init(AVCodecContext *avctx)
>>                  "Unsupported frame duration %.1f ms.\n", frame_us / 1000.f);
>>           return AVERROR(EINVAL);
>>       }
>> +    if (channels < 0 || channels > ENCODER_MAX_CHANNELS) {
>> +        av_log(avctx, AV_LOG_ERROR,
>> +               "Unsupported channel count %d. Should be 1 or 2\n", channels);
>> +        return AVERROR(EINVAL);
>> +    }
>>   
>>       hr_mode |= srate_hz > 48000;
>>       hr_mode &= srate_hz >= 48000;
>> @@ -195,9 +200,6 @@ const FFCodec ff_liblc3_encoder = {
>>       .p.type         = AVMEDIA_TYPE_AUDIO,
>>       .p.id           = AV_CODEC_ID_LC3,
>>       .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
> 
>> -    .p.ch_layouts = (const AVChannelLayout[])
>> -        { { AV_CHANNEL_ORDER_UNSPEC, 1 },
>> -          { AV_CHANNEL_ORDER_UNSPEC, 2 }, { 0 } },
> 
> shouldn't this be equivalent?
> 
> Should be good anyway.

No, because if you pass it a mono or stereo layout, the generic encode 
code will reject it, whereas after this change it will work because the 
encoder will only cares about channel count, not overall layout.
_______________________________________________
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".