Commit 84784c29 authored by Diego Biurrun's avatar Diego Biurrun

libfdk-aacdec: formatting cosmetics

parent 8506ff97
...@@ -85,16 +85,18 @@ static int get_stream_info(AVCodecContext *avctx) ...@@ -85,16 +85,18 @@ static int get_stream_info(AVCodecContext *avctx)
} }
channel_counts[ctype]++; channel_counts[ctype]++;
} }
av_log(avctx, AV_LOG_DEBUG, "%d channels - front:%d side:%d back:%d lfe:%d top:%d\n", av_log(avctx, AV_LOG_DEBUG,
"%d channels - front:%d side:%d back:%d lfe:%d top:%d\n",
info->numChannels, info->numChannels,
channel_counts[ACT_FRONT], channel_counts[ACT_SIDE], channel_counts[ACT_FRONT], channel_counts[ACT_SIDE],
channel_counts[ACT_BACK], channel_counts[ACT_LFE], channel_counts[ACT_BACK], channel_counts[ACT_LFE],
channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] + channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] +
channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]); channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]);
switch (channel_counts[ACT_FRONT]) { switch (channel_counts[ACT_FRONT]) {
case 4: case 4:
ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER |
AV_CH_FRONT_RIGHT_OF_CENTER;
break; break;
case 3: case 3:
ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER; ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER;
...@@ -106,8 +108,9 @@ static int get_stream_info(AVCodecContext *avctx) ...@@ -106,8 +108,9 @@ static int get_stream_info(AVCodecContext *avctx)
ch_layout |= AV_CH_FRONT_CENTER; ch_layout |= AV_CH_FRONT_CENTER;
break; break;
default: default:
av_log(avctx, AV_LOG_WARNING, "unsupported number of front channels: %d\n", av_log(avctx, AV_LOG_WARNING,
channel_counts[ACT_FRONT]); "unsupported number of front channels: %d\n",
channel_counts[ACT_FRONT]);
ch_error = 1; ch_error = 1;
break; break;
} }
...@@ -115,7 +118,8 @@ static int get_stream_info(AVCodecContext *avctx) ...@@ -115,7 +118,8 @@ static int get_stream_info(AVCodecContext *avctx)
if (channel_counts[ACT_SIDE] == 2) { if (channel_counts[ACT_SIDE] == 2) {
ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT; ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
} else { } else {
av_log(avctx, AV_LOG_WARNING, "unsupported number of side channels: %d\n", av_log(avctx, AV_LOG_WARNING,
"unsupported number of side channels: %d\n",
channel_counts[ACT_SIDE]); channel_counts[ACT_SIDE]);
ch_error = 1; ch_error = 1;
} }
...@@ -132,8 +136,9 @@ static int get_stream_info(AVCodecContext *avctx) ...@@ -132,8 +136,9 @@ static int get_stream_info(AVCodecContext *avctx)
ch_layout |= AV_CH_BACK_CENTER; ch_layout |= AV_CH_BACK_CENTER;
break; break;
default: default:
av_log(avctx, AV_LOG_WARNING, "unsupported number of back channels: %d\n", av_log(avctx, AV_LOG_WARNING,
channel_counts[ACT_BACK]); "unsupported number of back channels: %d\n",
channel_counts[ACT_BACK]);
ch_error = 1; ch_error = 1;
break; break;
} }
...@@ -142,7 +147,8 @@ static int get_stream_info(AVCodecContext *avctx) ...@@ -142,7 +147,8 @@ static int get_stream_info(AVCodecContext *avctx)
if (channel_counts[ACT_LFE] == 1) { if (channel_counts[ACT_LFE] == 1) {
ch_layout |= AV_CH_LOW_FREQUENCY; ch_layout |= AV_CH_LOW_FREQUENCY;
} else { } else {
av_log(avctx, AV_LOG_WARNING, "unsupported number of LFE channels: %d\n", av_log(avctx, AV_LOG_WARNING,
"unsupported number of LFE channels: %d\n",
channel_counts[ACT_LFE]); channel_counts[ACT_LFE]);
ch_error = 1; ch_error = 1;
} }
...@@ -184,14 +190,16 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx) ...@@ -184,14 +190,16 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
} }
if (avctx->extradata_size) { if (avctx->extradata_size) {
if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata, &avctx->extradata_size)) != AAC_DEC_OK) { if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata,
&avctx->extradata_size)) != AAC_DEC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n"); av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} }
if (s->conceal_method != CONCEAL_METHOD_DEFAULT) { if (s->conceal_method != CONCEAL_METHOD_DEFAULT) {
if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD, s->conceal_method)) != AAC_DEC_OK) { if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD,
s->conceal_method)) != AAC_DEC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n"); av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n");
return AVERROR_UNKNOWN; return AVERROR_UNKNOWN;
} }
...@@ -241,7 +249,8 @@ static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data, ...@@ -241,7 +249,8 @@ static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
goto end; goto end;
} }
if (err != AAC_DEC_OK) { if (err != AAC_DEC_OK) {
av_log(avctx, AV_LOG_ERROR, "aacDecoder_DecodeFrame() failed: %x\n", err); av_log(avctx, AV_LOG_ERROR,
"aacDecoder_DecodeFrame() failed: %x\n", err);
ret = AVERROR_UNKNOWN; ret = AVERROR_UNKNOWN;
goto end; goto end;
} }
...@@ -280,7 +289,8 @@ static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx) ...@@ -280,7 +289,8 @@ static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx)
if (!s->handle) if (!s->handle)
return; return;
if ((err = aacDecoder_SetParam(s->handle, AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK) if ((err = aacDecoder_SetParam(s->handle,
AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK)
av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n"); av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment