diff mbox

[FFmpeg-devel] avcodec/aacenc: report channel layout by name

Message ID 20180706214950.GA2904@sunshine.barsnick.net
State Accepted
Commit 1693a6818730760b3f2e9fbc13354dcb6c31c86f
Headers show

Commit Message

Moritz Barsnick July 6, 2018, 9:49 p.m. UTC
Possibly useful in the error case.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
---
 libavcodec/aacenc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Moritz Barsnick Sept. 7, 2018, 7:35 p.m. UTC | #1
On Fri, Jul 06, 2018 at 23:49:50 +0200, Moritz Barsnick wrote:
> Possibly useful in the error case.

Ping.
Michael Niedermayer Sept. 9, 2018, 1:05 a.m. UTC | #2
On Fri, Jul 06, 2018 at 11:49:50PM +0200, Moritz Barsnick wrote:
> Possibly useful in the error case.
> 
> Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
> ---
>  libavcodec/aacenc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 6d94c76905..4d0abb107f 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -982,11 +982,13 @@  static av_cold int aac_encode_init(AVCodecContext *avctx)
     }
 
     if (s->needs_pce) {
+        char buf[64];
         for (i = 0; i < FF_ARRAY_ELEMS(aac_pce_configs); i++)
             if (avctx->channel_layout == aac_pce_configs[i].layout)
                 break;
-        ERROR_IF(i == FF_ARRAY_ELEMS(aac_pce_configs), "Unsupported channel layout\n");
-        av_log(avctx, AV_LOG_INFO, "Using a PCE to encode channel layout\n");
+        av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout);
+        ERROR_IF(i == FF_ARRAY_ELEMS(aac_pce_configs), "Unsupported channel layout \"%s\"\n", buf);
+        av_log(avctx, AV_LOG_INFO, "Using a PCE to encode channel layout \"%s\"\n", buf);
         s->pce = aac_pce_configs[i];
         s->reorder_map = s->pce.reorder_map;
         s->chan_map = s->pce.config_map;