From be1efe5993483374566ba4993b1bd95eb2ef9a19 Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Mon, 20 Apr 2009 00:34:08 +0000
Subject: [PATCH] ac3enc: log a warning message if the channel layout is not
 specified at the time of codec initialization.

Originally committed as revision 18631 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/ac3enc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 8714da00cfd..7d12e04b302 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -667,6 +667,11 @@ static av_cold int AC3_encode_init(AVCodecContext *avctx)
 
     ac3_common_init();
 
+    if (!avctx->channel_layout) {
+        av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The "
+                                      "encoder will guess the layout, but it "
+                                      "might be incorrect.\n");
+    }
     if (set_channel_info(s, avctx->channels, &avctx->channel_layout)) {
         av_log(avctx, AV_LOG_ERROR, "invalid channel layout\n");
         return -1;
-- 
GitLab