* Ahead Software AG
*/
-/** \file aacdec.c paraslash's mp3 decoder */
+/** \file aacdec.c paraslash's aac (m4a) decoder */
#include "para.h"
#include "string.h"
#include "aac.h"
-/** the output buffer size */
#define MAX_CHANNELS 6
+/** the output buffer size */
#define AAC_OUTBUF_SIZE (FAAD_MIN_STREAMSIZE * MAX_CHANNELS)
/**
* \sa filter, filter_node
*/
struct private_aacdec_data {
- NeAACDecHandle decoder;
+ NeAACDecHandle handle;
NeAACDecFrameInfo frame_info;
int initialized;
int decoder_length;
long unsigned consumed_total;
-
long unsigned entry;
};
{
struct private_aacdec_data *padd = fn->private_data;
struct filter_chain_info *fci = fn->fci;
- unsigned long rate = 0;
- unsigned char channels = 0;
int i, ret, skip;
unsigned char *p, *outbuffer;
unsigned char *inbuf = (unsigned char*)input_buffer;
return 0;
if (!padd->initialized) {
+ unsigned long rate = 0;
+ unsigned char channels = 0;
padd->decoder_length = aac_find_esds(inbuf, len, &skip);
PARA_INFO_LOG("decoder len: %d\n", padd->decoder_length);
if (padd->decoder_length < 0) {
- ret = NeAACDecInit(padd->decoder, inbuf,
+ ret = NeAACDecInit(padd->handle, inbuf,
len, &rate, &channels);
PARA_INFO_LOG("decoder init: %d\n", ret);
if (ret < 0) {
consumed += skip;
p = inbuf + consumed;
ret = -E_AACDEC_INIT;
- if (NeAACDecInit2(padd->decoder, p,
+ if (NeAACDecInit2(padd->handle, p,
padd->decoder_length, &rate,
&channels) < 0)
goto out;
if (consumed >= len)
goto success;
p = inbuf + consumed;
- outbuffer = NeAACDecDecode(padd->decoder, &padd->frame_info, p,
+ outbuffer = NeAACDecDecode(padd->handle, &padd->frame_info, p,
len - consumed);
ret = -E_AAC_DECODE;
if (padd->frame_info.error != 0) {
fn->bufsize = AAC_OUTBUF_SIZE;
fn->buf = para_calloc(fn->bufsize);
- padd->decoder = aac_open();
+ padd->handle = aac_open();
}
static void aacdec_close(struct filter_node *fn)
{
struct private_aacdec_data *padd = fn->private_data;
- NeAACDecClose(padd->decoder);
+ NeAACDecClose(padd->handle);
free(fn->buf);
fn->buf = NULL;
free(padd);
}
/**
- * the init function of the mp3dec filter
+ * the init function of the aacdec filter
*
* \sa filter::init
*/