/** the return value of aac_open */
NeAACDecHandle handle;
/** whether this instance of the aac decoder is already initialized */
- int initialized;
+ bool initialized;
/** number of times the decoder returned an error */
unsigned error_count;
/** number of bytes already consumed from the imput stream */
unsigned int sample_rate;
};
-/*
- * Get a new libfaad decoder handle.
- *
- * \return The handle returned by NeAACDecOpen().
- */
-static NeAACDecHandle aac_open(void)
-{
- NeAACDecHandle h = NeAACDecOpen();
- NeAACDecConfigurationPtr c = NeAACDecGetCurrentConfiguration(h);
-
- c->defObjectType = LC;
- c->outputFormat = FAAD_FMT_16BIT;
- c->downMatrix = 0;
- NeAACDecSetConfiguration(h, c);
- return h;
-}
-
static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result)
{
struct filter_node *fn = btr_context(btrn);
static void aacdec_open(struct filter_node *fn)
{
+ NeAACDecConfigurationPtr c;
struct private_aacdec_data *padd = para_calloc(sizeof(*padd));
+ padd->handle = NeAACDecOpen();
+ c = NeAACDecGetCurrentConfiguration(padd->handle);
+ c->defObjectType = LC;
+ c->outputFormat = FAAD_FMT_16BIT;
+ c->downMatrix = 0;
+ NeAACDecSetConfiguration(padd->handle, c);
+
fn->private_data = padd;
fn->min_iqs = 2048;
- padd->handle = aac_open();
}
static void aacdec_close(struct filter_node *fn)
padd->channels = channels;
PARA_INFO_LOG("rate: %u, channels: %u\n",
padd->sample_rate, padd->channels);
- padd->initialized = 1;
+ padd->initialized = true;
}
if (consumed >= len)
goto success;