aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-29 18:45:32 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-01-30 03:41:47 +0100
commit4592c85fc888ed32df2486c04914286f403c3a80 (patch)
tree18731f8fcd96128a2b2e4991a61db37fad904a2b
parent5255acc6beb61ef30f43bc2c746b0b487815f76d (diff)
downloadffmpeg-4592c85fc888ed32df2486c04914286f403c3a80.tar.gz
Flush final frames in libfaac encoder.
Gives decoded output identical in length to faac commandline encoder. Fixes Issue 670. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 243f8241dbf4a451e1197661ccd387c519ae3349)
-rw-r--r--libavcodec/libfaac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c
index 79ab729c13..af85587272 100644
--- a/libavcodec/libfaac.c
+++ b/libavcodec/libfaac.c
@@ -124,10 +124,11 @@ static int Faac_encode_frame(AVCodecContext *avctx,
{
FaacAudioContext *s = avctx->priv_data;
int bytes_written;
+ int num_samples = data ? avctx->frame_size : 0;
bytes_written = faacEncEncode(s->faac_handle,
data,
- avctx->frame_size * avctx->channels,
+ num_samples * avctx->channels,
frame,
buf_size);
@@ -161,6 +162,7 @@ AVCodec ff_libfaac_encoder = {
Faac_encode_init,
Faac_encode_frame,
Faac_encode_close,
+ .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
.profiles = NULL_IF_CONFIG_SMALL(profiles),