[FFmpeg-cvslog] lavc/encoder: always print an error on an unsupported channel layout

Anton Khirnov git at videolan.org
Tue Jul 11 20:28:53 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Jul  6 18:25:40 2023 +0200| [fc6c746aa17fd4434cf81f045c4644ded02b0912] | committer: Anton Khirnov

lavc/encoder: always print an error on an unsupported channel layout

Even if the layout is indescribable.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc6c746aa17fd4434cf81f045c4644ded02b0912
---

 libavcodec/encode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index fd182007cc..f443f07e15 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -699,8 +699,8 @@ static int encode_preinit_audio(AVCodecContext *avctx)
         if (!c->ch_layouts[i].nb_channels) {
             char buf[512];
             int ret = av_channel_layout_describe(&avctx->ch_layout, buf, sizeof(buf));
-            if (ret > 0)
-                av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n", buf);
+            av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n",
+                   ret > 0 ? buf : "?");
             return AVERROR(EINVAL);
         }
     }



More information about the ffmpeg-cvslog mailing list