wma: Combine wmadec_cleanup() and wmadec_close().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 6 Jun 2017 08:07:44 +0000 (10:07 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 Jul 2017 19:00:36 +0000 (21:00 +0200)
Both functions are short, and the former is only called by the latter.

wmadec_filter.c

index 6ddedac..6a5df98 100644 (file)
@@ -159,23 +159,6 @@ static void sine_window_init(float *window, int n)
                window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n)));
 }
 
-static void wmadec_cleanup(struct private_wmadec_data *pwd)
-{
-       int i;
-
-       for (i = 0; i < pwd->nb_block_sizes; i++)
-               imdct_end(pwd->mdct_ctx[i]);
-       if (pwd->ahi.use_exp_vlc)
-               free_vlc(&pwd->exp_vlc);
-       if (pwd->use_noise_coding)
-               free_vlc(&pwd->hgain_vlc);
-       for (i = 0; i < 2; i++) {
-               free_vlc(&pwd->coef_vlc[i]);
-               free(pwd->run_table[i]);
-               free(pwd->level_table[i]);
-       }
-}
-
 static void init_coef_vlc(struct vlc *vlc, uint16_t **prun_table,
                uint16_t **plevel_table, const struct coef_vlc_table *vlc_table)
 {
@@ -1173,10 +1156,21 @@ fail:
 static void wmadec_close(struct filter_node *fn)
 {
        struct private_wmadec_data *pwd = fn->private_data;
+       int i;
 
        if (!pwd)
                return;
-       wmadec_cleanup(pwd);
+       for (i = 0; i < pwd->nb_block_sizes; i++)
+               imdct_end(pwd->mdct_ctx[i]);
+       if (pwd->ahi.use_exp_vlc)
+               free_vlc(&pwd->exp_vlc);
+       if (pwd->use_noise_coding)
+               free_vlc(&pwd->hgain_vlc);
+       for (i = 0; i < 2; i++) {
+               free_vlc(&pwd->coef_vlc[i]);
+               free(pwd->run_table[i]);
+               free(pwd->level_table[i]);
+       }
        free(fn->private_data);
        fn->private_data = NULL;
 }