*/
#include <vo-amrwbenc/enc_if.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "libavutil/avstring.h"
+#include "libavutil/internal.h"
+#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
} AMRWBContext;
static const AVOption options[] = {
- { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
+ { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
};
s->last_bitrate = avctx->bit_rate;
avctx->frame_size = 320;
- avctx->delay = 80;
-#if FF_API_OLD_ENCODE_AUDIO
- avctx->coded_frame = avcodec_alloc_frame();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-#endif
+ avctx->initial_padding = 80;
s->state = E_IF_init();
AMRWBContext *s = avctx->priv_data;
E_IF_exit(s->state);
- av_freep(&avctx->coded_frame);
return 0;
}
}
if (frame->pts != AV_NOPTS_VALUE)
- avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
+ avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
avpkt->size = size;
*got_packet_ptr = 1;
AVCodec ff_libvo_amrwbenc_encoder = {
.name = "libvo_amrwbenc",
+ .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB "
+ "(Adaptive Multi-Rate Wide-Band)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AMR_WB,
.priv_data_size = sizeof(AMRWBContext),
.close = amr_wb_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
- .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB "
- "(Adaptive Multi-Rate Wide-Band)"),
.priv_class = &class,
};