]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
compress filter: Fix parsing of the amplification string.
authorAndre Noll <maan@systemlinux.org>
Sun, 6 Jul 2008 18:52:13 +0000 (20:52 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 6 Jul 2008 18:52:13 +0000 (20:52 +0200)
We need to consider the prefix as well.

compress.c
filter.c

index dd77de8153d917f46f75df6ced1b580b55dd1386..8e2f07c9c4f3342e2984c5b4b8b2a0b047bb038c 100644 (file)
@@ -106,8 +106,11 @@ static void open_compress(struct filter_node *fn)
        fn->buf = para_malloc(fn->bufsize);
        pcd->current_gain = 1 << pcd->conf->inertia_arg;
        pcd->max_gain = 1 << (pcd->conf->inertia_arg + pcd->conf->aggressiveness_arg);
        fn->buf = para_malloc(fn->bufsize);
        pcd->current_gain = 1 << pcd->conf->inertia_arg;
        pcd->max_gain = 1 << (pcd->conf->inertia_arg + pcd->conf->aggressiveness_arg);
-       if (stat_item_values[SI_AMPLIFICATION])
-               sscanf(stat_item_values[SI_AMPLIFICATION], "%u", &pcd->amp);
+       if (stat_item_values[SI_AMPLIFICATION]) {
+               int i = SI_AMPLIFICATION;
+               char *s = stat_item_values[i] + strlen(status_item_list[i]) + 1;
+               sscanf(s, "%u", &pcd->amp);
+       }
        PARA_NOTICE_LOG("amplification: %u (scaling factor: %1.2f)\n", pcd->amp,
                pcd->amp / 64.0 + 1.0);
 }
        PARA_NOTICE_LOG("amplification: %u (scaling factor: %1.2f)\n", pcd->amp,
                pcd->amp / 64.0 + 1.0);
 }
index bab827d326c31d47063a8bf04e2083d18c966c52..09b644151a3cf4b8f081bf42743224b28a6829dd 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -17,6 +17,9 @@
 #include "stdout.h"
 #include "error.h"
 
 #include "stdout.h"
 #include "error.h"
 
+/** The list of all status items used by para_{server,audiod,gui}. */
+const char *status_item_list[] = {STATUS_ITEM_ARRAY};
+
 char *stat_item_values[NUM_STAT_ITEMS] = {NULL};
 
 /** Initialize the array of errors for para_filter. */
 char *stat_item_values[NUM_STAT_ITEMS] = {NULL};
 
 /** Initialize the array of errors for para_filter. */