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 BA33949157 for ; Thu, 4 Apr 2024 16:29:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 879CF68D0E8; Thu, 4 Apr 2024 19:29:46 +0300 (EEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A239568D0DD for ; Thu, 4 Apr 2024 19:29:39 +0300 (EEST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-29f69710cbbso867353a91.1 for ; Thu, 04 Apr 2024 09:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712248177; x=1712852977; darn=ffmpeg.org; 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=BdzoUz4hLSTc2iQUsmciDfT9bKT1LZmp5gXOScijA74=; b=UaxSxCEhMFWGRzQquRteIpH5fRtE2xvG0/lUitYdPsCyv4qMXhcZh8DYEbSrtff7UY WG56wvpaZe8vXfgD9BrQCG+YpGQADUnX9GtzUC/BYs7Z/AXz6nDvJ3M/XawWJeN8gfEw RcI4Vv9b0VOLujZThwOVC153Cbay+S0oy0dXnwP5Fx5uAbQ30RqrwYgezOH3ADIRG6BK pc9erUZIxcJwLXNPQg/O0KeFXwEAZmQsxusAfngIPcgDqDF07bjzwHr52L/wBpqwi3PR sGvJXICEVdymq/SDWGqKAaM4tKXF83eaet/Su1WMJXfEiDn0PdYtcgS8pWZ2KYujWoG6 2j9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712248177; x=1712852977; 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=BdzoUz4hLSTc2iQUsmciDfT9bKT1LZmp5gXOScijA74=; b=e5EByAnNlnM5KDFDzKfnqRykfbcSiv/+eh6z1s+CcrBSIdqy3RWgGSBSC43gtVxjTd CmAUhKjy0wL+xLCdK0IT7KDowTfZB/zewra+DAhMY4JujJ55yK7xfINPIId6ElMyty+4 kcNHz2UH7Rtxs9gFqA5TWUmYM7H9Qna0hCU7+UZynGGZuNV5eq9Clq0SbV9lsxkfpALD r5hBobUqpxVLrKf+/aFLeuSLoLdrguaove4O55jgIPC6N9OBLGCO4O6DRem2limnrSPx NPrQdBrDhRSmCpQQhOKG2gIbfxKRl53GkB1JnzM4nKt6jYj1e46MqqLmKvSPpWvBrjYQ +1kQ== X-Gm-Message-State: AOJu0YzXQYfsU3+aZo9FFskUIHHgQeA6pjemwQHaOxu6GFsR/QsXQgZ3 HfCocS+kmt1Aq2oyh0jiH51ap31o6dmH8ZztImUThAtb0zbwKNfPoLZk6LAp X-Google-Smtp-Source: AGHT+IE7pr5XrxAWzAwBrK71wyQGxekeEp+GdGLzmEmrBPXwEUVNYdiQwn7DkxA45saa+Gk6g8rWtw== X-Received: by 2002:a17:90b:3113:b0:2a2:1ec6:924 with SMTP id gc19-20020a17090b311300b002a21ec60924mr41096pjb.3.1712248176517; Thu, 04 Apr 2024 09:29:36 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id jx15-20020a17090b46cf00b002a2546fd6eesm1741104pjb.6.2024.04.04.09.29.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 09:29:36 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Apr 2024 13:29:36 -0300 Message-ID: <20240404162936.4581-2-jamrial@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404162936.4581-1-jamrial@gmail.com> References: <20240404162936.4581-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [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: 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[]) -- 2.44.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".