summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-06-10 11:45:03 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-06-13 16:49:35 -0400
commit36151b3e3112cd7d8ae0e02e850dee16bd966696 (patch)
tree10ce7bbebc6a9a1d79859a9cf89c89b57d4742bf /libavcodec/ac3enc.c
parent504811baeacf8bac400962e84fca678b79068ceb (diff)
downloadffmpeg-36151b3e3112cd7d8ae0e02e850dee16bd966696.tar.gz
ac3enc: use function pointer to choose between AC-3 and E-AC-3 header output
functions.
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r--libavcodec/ac3enc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index e8ccde514a..9403bf6443 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1987,10 +1987,7 @@ static void output_frame(AC3EncodeContext *s, unsigned char *frame)
init_put_bits(&s->pb, frame, AC3_MAX_CODED_FRAME_SIZE);
- if (CONFIG_EAC3_ENCODER && s->eac3)
- ff_eac3_output_frame_header(s);
- else
- ac3_output_frame_header(s);
+ s->output_frame_header(s);
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++)
output_audio_block(s, blk);
@@ -2732,6 +2729,12 @@ static av_cold int ac3_encode_init(AVCodecContext *avctx)
s->crc_inv[1] = pow_poly((CRC16_POLY >> 1), (8 * frame_size_58) - 16, CRC16_POLY);
}
+ /* set function pointers */
+ if (CONFIG_EAC3_ENCODER && s->eac3)
+ s->output_frame_header = ff_eac3_output_frame_header;
+ else
+ s->output_frame_header = ac3_output_frame_header;
+
set_bandwidth(s);
exponent_init(s);