diff mbox series

[FFmpeg-devel,09/17] avcodec/libcodec2: Remove dead channel count check

Message ID GV1P250MB07376B8B784444C17E2799198F4A9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit e6073665c43ec199b43689b5f305e7fed8f84379
Headers show
Series [FFmpeg-devel,01/17] avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 18, 2022, 8:27 p.m. UTC
This encoder has AVCodec.ch_layouts set, so that this is checked
generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/libcodec2.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Tomas Härdin Sept. 21, 2022, 1:31 p.m. UTC | #1
sön 2022-09-18 klockan 22:27 +0200 skrev Andreas Rheinhardt:
> This encoder has AVCodec.ch_layouts set, so that this is checked
> generically.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/libcodec2.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c
> index be9677ddeb..581ef04ce2 100644
> --- a/libavcodec/libcodec2.c
> +++ b/libavcodec/libcodec2.c
> @@ -105,7 +105,6 @@ static av_cold int
> libcodec2_init_encoder(AVCodecContext *avctx)
>  
>      //will need to be smarter once we get wideband support
>      if (avctx->sample_rate != 8000 ||
> -        avctx->ch_layout.nb_channels != 1 ||
>          avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
>          av_log(avctx, AV_LOG_ERROR, "only 8 kHz 16-bit mono
> allowed\n");
>          return AVERROR(EINVAL);

Should be fine
diff mbox series

Patch

diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c
index be9677ddeb..581ef04ce2 100644
--- a/libavcodec/libcodec2.c
+++ b/libavcodec/libcodec2.c
@@ -105,7 +105,6 @@  static av_cold int libcodec2_init_encoder(AVCodecContext *avctx)
 
     //will need to be smarter once we get wideband support
     if (avctx->sample_rate != 8000 ||
-        avctx->ch_layout.nb_channels != 1 ||
         avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
         av_log(avctx, AV_LOG_ERROR, "only 8 kHz 16-bit mono allowed\n");
         return AVERROR(EINVAL);