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 85DA24A711 for ; Thu, 4 Apr 2024 17:02:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 44E1F68D0E0; Thu, 4 Apr 2024 20:02:42 +0300 (EEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3781C68CFDA for ; Thu, 4 Apr 2024 20:02:36 +0300 (EEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a46ba938de0so181385666b.3 for ; Thu, 04 Apr 2024 10:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712250155; x=1712854955; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=CmPddUFHQbvJzi+aNu7Z6TKGvusf5Ptw7J7b6zG7OII=; b=IjaV2YRkp4zl3pLvDisWNI5Ul60ZGqZ2f11MqNOKH7SasNXtBHbOoDxBJojFmZnd6J yJY88+8M0fPtD4b2MGSM+XO+4IwkoIrH8nz5V9Kly8O0c1TxAZRI+z+J0XRRPQg+jRxB 8SZN6qWL7XT0unkBZwj/6WG6b5QwNDq8FSYLm6wQ80bcOUJSB+dgTG2pRk8Gsk1BkbcF wneatcCNunYeG5mNpFUdhjIRWQsvVxW9W9pfhpWP71ZhULFICMKXSlFY5bIP9GtyJlX0 Z5RzPxN5ssBrKTdyvAAb/AKn2cHAuuQiUwpU9Ylk9JcAPlslhofpHKw+ZimUtHzAI9OP oGug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712250155; x=1712854955; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CmPddUFHQbvJzi+aNu7Z6TKGvusf5Ptw7J7b6zG7OII=; b=nIXr9uu5Ap1u2ia8VkwGqe/0gfVpYe4DRB2rLW/vOnumO3xffHkklD25/A61fF6GfE QFQyx8KTHO0hmqstW+FftlwFIpE5HK89ElFaFmuBfCOYuR3Ul3ZJYBpW3H9lpavhMl0a IkoDU97AiAi4O9p1/bZH3Dl765WfApWG8W8PZYrc748qOwTv3esqPQLxboSOsCfSn5AJ gjyRgCjqw0pXB5F4S7bygxrdmHy4ViricPL5TA+ZaMrPqak526LsaYSe1cHAcvn3nhMj FVuvoz6aeJ6fIGXBMuQ/c1BuemJaWcQB6FrH5jnCM2zzmDYcPQV+vXkv3vi7aFQNIudC w9kQ== X-Gm-Message-State: AOJu0YyPO2d3LaYBWDjHsfnwdzwoXcPQfYYCNVrtbsXcfNICWJohhLtZ MmTJH4kpz1Jrd7uvNKZ0h7jjNgNFG1PxB7vB2cCgElBtjeAvd8U/FM7mV2Vk X-Google-Smtp-Source: AGHT+IEDCgHWVKSll1uNogvuezlVKrDMj7va6zY51JxNC2sA2kf8LinzQmdVnfNBQk/7yoZBMKG27g== X-Received: by 2002:a17:906:28d4:b0:a4e:375b:ef1a with SMTP id p20-20020a17090628d400b00a4e375bef1amr2193454ejd.13.1712250154960; Thu, 04 Apr 2024 10:02:34 -0700 (PDT) Received: from mariano (host-79-42-51-175.retail.telecomitalia.it. [79.42.51.175]) by smtp.gmail.com with ESMTPSA id u14-20020a170906780e00b00a46c8dbd5e4sm9193868ejm.7.2024.04.04.10.02.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 10:02:34 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 92CA0BFCE8; Thu, 4 Apr 2024 19:02:33 +0200 (CEST) Date: Thu, 4 Apr 2024 19:02:33 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20240404162936.4581-1-jamrial@gmail.com> <20240404162936.4581-2-jamrial@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) 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 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: On date Thursday 2024-04-04 18:59:09 +0200, Andreas Rheinhardt wrote: > James Almer: > > We only care about channel count. Layout details will be ignored either way. > > > > Signed-off-by: James Almer > > --- > > 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 } }, > > .p.supported_samplerates = (const int []) > > { 96000, 48000, 32000, 24000, 16000, 8000, 0 }, > > .p.sample_fmts = (const enum AVSampleFormat[]) > > I think we should rather change encode.c to mean that an UNSPEC channel > layout (in AVCodec.ch_layouts) works with every channel layout with the > same number of channels. This was my naive interpretation of the code, without checking the code. This would probably save some boilerplate (OTOH it should also be fine to apply the hotfix). _______________________________________________ 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".