#include <faac.h>
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
#include "avcodec.h"
#include "audio_frame_queue.h"
#include "internal.h"
-#include "libavutil/audioconvert.h"
-#include "libavutil/common.h"
/* libfaac has an encoder delay of 1024 samples */
{
FaacAudioContext *s = avctx->priv_data;
-#if FF_API_OLD_ENCODE_AUDIO
- av_freep(&avctx->coded_frame);
-#endif
av_freep(&avctx->extradata);
ff_af_queue_close(&s->afq);
avctx->frame_size = samples_input / avctx->channels;
-#if FF_API_OLD_ENCODE_AUDIO
- avctx->coded_frame= avcodec_alloc_frame();
- if (!avctx->coded_frame) {
- ret = AVERROR(ENOMEM);
- goto error;
- }
-#endif
-
/* Set decoder specific info */
avctx->extradata_size = 0;
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
memcpy(avctx->extradata, buffer, avctx->extradata_size);
faac_cfg->outputFormat = 0;
}
-#undef free
free(buffer);
-#define free please_use_av_free
}
if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
goto error;
}
- avctx->delay = FAAC_DELAY_SAMPLES;
+ avctx->initial_padding = FAAC_DELAY_SAMPLES;
ff_af_queue_init(avctx, &s->afq);
return 0;
/* add current frame to the queue */
if (frame) {
- if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
+ if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
return ret;
}
AVCodec ff_libfaac_encoder = {
.name = "libfaac",
+ .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(FaacAudioContext),
.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 Coding)"),
.profiles = NULL_IF_CONFIG_SMALL(profiles),
.channel_layouts = faac_channel_layouts,
};