From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 2/2] avcodec/liblc3enc: don't force unspec channel layouts
Date: Thu, 4 Apr 2024 18:59:09 +0200
Message-ID: <GV1P250MB073770EE60C5A90A7F195E998F3C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20240404162936.4581-2-jamrial@gmail.com>
James Almer:
> 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 } },
> .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.
- Andreas
_______________________________________________
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".
next prev parent reply other threads:[~2024-04-04 16:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 16:29 [FFmpeg-devel] [PATCH 1/2] avcodec/liblc3dec: sanitize channel count in avctx James Almer
2024-04-04 16:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/liblc3enc: don't force unspec channel layouts James Almer
2024-04-04 16:45 ` Stefano Sabatini
2024-04-04 16:53 ` James Almer
2024-04-04 16:59 ` Andreas Rheinhardt [this message]
2024-04-04 17:02 ` Stefano Sabatini
2024-04-04 16:40 ` [FFmpeg-devel] [PATCH 1/2] avcodec/liblc3dec: sanitize channel count in avctx Stefano Sabatini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=GV1P250MB073770EE60C5A90A7F195E998F3C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git