Commit e4eca0d8 authored by superdump's avatar superdump

Cosmetics: indentation

Patch by Thorsten Jordan (tjordan atay macrosystem otday de)
[FFmpeg-devel] Behaviour of liba52 decoder


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11927 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3bfbbfeb
...@@ -160,46 +160,46 @@ static int a52_decode_frame(AVCodecContext *avctx, ...@@ -160,46 +160,46 @@ static int a52_decode_frame(AVCodecContext *avctx,
return -1; return -1;
} }
len = s->a52_syncinfo(buf, &s->flags, &sample_rate, &bit_rate); len = s->a52_syncinfo(buf, &s->flags, &sample_rate, &bit_rate);
if (len == 0) { if (len == 0) {
av_log(avctx, AV_LOG_ERROR, "Error decoding frame, no sync byte at begin\n"); av_log(avctx, AV_LOG_ERROR, "Error decoding frame, no sync byte at begin\n");
return -1; return -1;
} }
if (buf_size < len) { if (buf_size < len) {
av_log(avctx, AV_LOG_ERROR, "Error decoding frame, not enough bytes\n"); av_log(avctx, AV_LOG_ERROR, "Error decoding frame, not enough bytes\n");
return -1; return -1;
} }
/* update codec info */ /* update codec info */
avctx->sample_rate = sample_rate; avctx->sample_rate = sample_rate;
s->channels = ac3_channels[s->flags & 7]; s->channels = ac3_channels[s->flags & 7];
if (s->flags & A52_LFE) if (s->flags & A52_LFE)
s->channels++; s->channels++;
if (avctx->request_channels > 0 && if (avctx->request_channels > 0 &&
avctx->request_channels <= 2 && avctx->request_channels <= 2 &&
avctx->request_channels < s->channels) { avctx->request_channels < s->channels) {
avctx->channels = avctx->request_channels; avctx->channels = avctx->request_channels;
} else { } else {
avctx->channels = s->channels; avctx->channels = s->channels;
} }
avctx->bit_rate = bit_rate; avctx->bit_rate = bit_rate;
flags = s->flags; flags = s->flags;
if (avctx->channels == 1) if (avctx->channels == 1)
flags = A52_MONO; flags = A52_MONO;
else if (avctx->channels == 2) else if (avctx->channels == 2)
flags = A52_STEREO; flags = A52_STEREO;
else else
flags |= A52_ADJUST_LEVEL; flags |= A52_ADJUST_LEVEL;
level = 1; level = 1;
if (s->a52_frame(s->state, buf, &flags, &level, 384)) { if (s->a52_frame(s->state, buf, &flags, &level, 384)) {
fail: fail:
av_log(avctx, AV_LOG_ERROR, "Error decoding frame\n"); av_log(avctx, AV_LOG_ERROR, "Error decoding frame\n");
return -1; return -1;
} }
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
if (s->a52_block(s->state)) if (s->a52_block(s->state))
goto fail; goto fail;
float_to_int(s->samples, out_samples + i * 256 * avctx->channels, avctx->channels); float_to_int(s->samples, out_samples + i * 256 * avctx->channels, avctx->channels);
} }
*data_size = 6 * avctx->channels * 256 * sizeof(int16_t); *data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
return len; return len;
} }
......
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