*/
/**
- * @file libfaac.c
+ * @file
* Interface to libfaac for aac encoding.
*/
{
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);
return 0;
}
-AVCodec libfaac_encoder = {
+static const AVProfile profiles[] = {
+ { FF_PROFILE_AAC_MAIN, "Main" },
+ { FF_PROFILE_AAC_LOW, "LC" },
+ { FF_PROFILE_AAC_SSR, "SSR" },
+ { FF_PROFILE_AAC_LTP, "LTP" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+AVCodec ff_libfaac_encoder = {
"libfaac",
- CODEC_TYPE_AUDIO,
+ AVMEDIA_TYPE_AUDIO,
CODEC_ID_AAC,
sizeof(FaacAudioContext),
Faac_encode_init,
Faac_encode_frame,
Faac_encode_close,
- .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
+ .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),
};