Even if the layout is indescribable.
---
 libavcodec/encode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 0d44f70ee9..ba91dcc31e 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -675,8 +675,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);
         }
     }
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to