avcodec/aacenc: report channel layout by name

Possibly useful in the error case.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/296/head
Moritz Barsnick 7 years ago committed by Michael Niedermayer
parent 05df39cf3f
commit 1693a68187
  1. 6
      libavcodec/aacenc.c

@ -982,11 +982,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
} }
if (s->needs_pce) { if (s->needs_pce) {
char buf[64];
for (i = 0; i < FF_ARRAY_ELEMS(aac_pce_configs); i++) for (i = 0; i < FF_ARRAY_ELEMS(aac_pce_configs); i++)
if (avctx->channel_layout == aac_pce_configs[i].layout) if (avctx->channel_layout == aac_pce_configs[i].layout)
break; break;
ERROR_IF(i == FF_ARRAY_ELEMS(aac_pce_configs), "Unsupported channel layout\n"); av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout);
av_log(avctx, AV_LOG_INFO, "Using a PCE to encode channel layout\n"); 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->pce = aac_pce_configs[i];
s->reorder_map = s->pce.reorder_map; s->reorder_map = s->pce.reorder_map;
s->chan_map = s->pce.config_map; s->chan_map = s->pce.config_map;

Loading…
Cancel
Save