Both functions are short, and they are only called once at
startup. Thus, there is no reason to spread out the initialization
over two functions, so let's combine them.
unsigned int sample_rate;
};
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 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)
{
static void aacdec_open(struct filter_node *fn)
{
+ NeAACDecConfigurationPtr c;
struct private_aacdec_data *padd = para_calloc(sizeof(*padd));
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;
fn->private_data = padd;
fn->min_iqs = 2048;
- padd->handle = aac_open();
}
static void aacdec_close(struct filter_node *fn)
}
static void aacdec_close(struct filter_node *fn)