]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge commit 'meins/master'
authorAndre Noll <maan@systemlinux.org>
Mon, 7 Jul 2008 08:53:31 +0000 (10:53 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 7 Jul 2008 08:53:31 +0000 (10:53 +0200)
12 files changed:
NEWS
afs.c
afs.cmd
afs.h
aft.c
audiod.c
audiod.h
audiod_command.c
compress.c
configure.ac
filter.c
score.c

diff --git a/NEWS b/NEWS
index 3e5f1ce8b0e406bd27e3ba6b119de53b907274f9..7404ab1d4b6f7cdf7e8439274e08f9a3445718a2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,13 +5,17 @@ NEWS
 0.3.3 (to be announced) "axiomatic perspectivity"
 -------------------------------------------------
 
-Internal code cleanups and improved tag handling.
+Internal code cleanups, improved tag handling and the new
+amplification feature.
 
        - para_server uses the generic scheduling code.
        - overhaul of the virtual streaming system.
        - mp3: id3 version 2 support via libid3tag (optional)
        - ogg: vorbis comment support.
        - mp3 audio format handler cleanups.
+       - new status item/database entry: amplification. It is
+         used by the compress filter to pre-amplify the amplitude of the
+         audio stream.
 
 -----------------------------------------
 0.3.2 (2008-04-11) "probabilistic parity"
diff --git a/afs.c b/afs.c
index 58b04a8bafce749308aefe17d42ebaf178d4d45b..64d3b0f82fb9005b9e526d7ff3265640d3777114 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -1185,7 +1185,8 @@ void afs_event(enum afs_events event, struct para_buffer *pb,
                        continue;
                ret = t->event_handler(event, pb, data);
                if (ret < 0)
-                       PARA_CRIT_LOG("%s\n", para_strerror(-ret));
+                       PARA_CRIT_LOG("table %s, event %d: %s\n", t->name,
+                               event, para_strerror(-ret));
        }
 }
 
diff --git a/afs.cmd b/afs.cmd
index 3f44873e444d7036f7b12b42fe4127420786cd71..5c9f1ecb5c78cd01a8dbcf86b7adc5cd4e6449d5 100644 (file)
--- a/afs.cmd
+++ b/afs.cmd
@@ -180,7 +180,7 @@ H:  a slash (see fnmatch(3)).
 N: touch
 P: AFS_READ | AFS_WRITE
 D: Manipulate the afs data for all audio files matching a pattern.
-U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] [-v] [-p] pattern
+U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] [-a amp] [-v] [-p] pattern
 H: If no option is given, lastplayed is set to the current time
 H: and numplayed is increased by one. Otherwise, only the given
 H: options are taken into account.
@@ -202,6 +202,14 @@ H:         this audio file.
 H:
 H: -i  Set the image id. Same as -y, but sets the image.
 H:
+H: -a  Set the amplification value (0-255). This determines a scaling
+H:     factor by which the amplitude should be multiplied in order to
+H:     normalize the volume of the audio file.  A value of zero means
+H:     no amplification, 64 means the amplitude should be multiplied
+H:     by a factor of two, 128 by three and so on.
+H:
+H:     This value is used by the compress filter.
+H:
 H: -v  Verbose mode. Explain what is being done.
 H:
 H: -p  Pathname match. Match a slash in the path only with a slash
diff --git a/afs.h b/afs.h
index d01f0cfb77cc17eaff5e5618cb734f54a6f9fa5e..a596317f957f2dabb8a7287d689810883f4270b6 100644 (file)
--- a/afs.h
+++ b/afs.h
@@ -24,6 +24,8 @@ struct afs_info {
        uint32_t lyrics_id;
        /** Mp3, ogg or aac. */
        uint8_t audio_format_id;
+       /** Amplification value. */
+       uint8_t amp;
 };
 
 /**
diff --git a/aft.c b/aft.c
index 3d10ced25949d61e370eae617950dd7ff316b7e6..922f04229c47ea3545f401bf3c6429ef86695e1d 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -98,6 +98,8 @@ struct ls_widths {
        unsigned short duration_width;
        /** size of the num played field. */
        unsigned short num_played_width;
+       /** size of the amp field. */
+       unsigned short amp_width;
 };
 
 /** Data passed from the ls command handler to its callback function. */
@@ -142,8 +144,10 @@ enum afsi_offsets {
        AFSI_LYRICS_ID_OFFSET = 24,
        /** Storage position of the .audio_format_id field. */
        AFSI_AUDIO_FORMAT_ID_OFFSET = 28,
-       /** 3 bytes reserved space for future usage. */
-       AFSI_AUDIO_FORMAT_UNUSED_OFFSET = 29,
+       /** Storage position of the amplification field. */
+       AFSI_AMP_OFFSET = 29,
+       /** 2 bytes reserved space for future usage. */
+       AFSI_AUDIO_FORMAT_UNUSED_OFFSET = 30,
        /** On-disk storage space needed. */
        AFSI_SIZE = 32
 };
@@ -167,7 +171,8 @@ void save_afsi(struct afs_info *afsi, struct osl_object *obj)
        write_u32(buf + AFSI_LYRICS_ID_OFFSET, afsi->lyrics_id);
        write_u8(buf + AFSI_AUDIO_FORMAT_ID_OFFSET,
                afsi->audio_format_id);
-       memset(buf + AFSI_AUDIO_FORMAT_UNUSED_OFFSET, 0, 3);
+       write_u8(buf + AFSI_AMP_OFFSET, afsi->amp);
+       memset(buf + AFSI_AUDIO_FORMAT_UNUSED_OFFSET, 0, 2);
 }
 
 /**
@@ -192,6 +197,7 @@ int load_afsi(struct afs_info *afsi, struct osl_object *obj)
        afsi->lyrics_id = read_u32(buf + AFSI_LYRICS_ID_OFFSET);
        afsi->audio_format_id = read_u8(buf +
                AFSI_AUDIO_FORMAT_ID_OFFSET);
+       afsi->amp = read_u8(buf + AFSI_AMP_OFFSET);
        return 1;
 }
 
@@ -899,6 +905,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                ret = para_printf(b,
                        "%s"    /* score */
                        "%s "   /* attributes */
+                       "%*u "  /* amp */
                        "%*d "  /* image_id  */
                        "%*d "  /* lyrics_id */
                        "%*d "  /* bitrate */
@@ -911,6 +918,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                        "%s\n", /* path */
                        score_buf,
                        att_buf,
+                       w->amp_width, afsi->amp,
                        w->image_id_width, afsi->image_id,
                        w->lyrics_id_width, afsi->lyrics_id,
                        w->bitrate_width, afhi->bitrate,
@@ -955,6 +963,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                "%s: %lu\n" /* seconds total */
                "%s: %s\n" /* last played time */
                "%s: %d\n" /* num_played */
+               "%s: %u\n" /* ampplification */
                "%s" /* tag info */
                "%s: %lu\n" /* chunk time */
                "%s: %lu\n", /* num chunks */
@@ -975,6 +984,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                status_item_list[SI_SECONDS_TOTAL], afhi->seconds_total,
                status_item_list[SI_LAST_PLAYED], last_played_time,
                status_item_list[SI_NUM_PLAYED], afsi->num_played,
+               status_item_list[SI_AMPLIFICATION], afsi->amp,
                afhi->info_string,
                status_item_list[SI_CHUNK_TIME], tv2ms(&afhi->chunk_tv),
                status_item_list[SI_NUM_CHUNKS], afhi->chunks_total
@@ -1245,6 +1255,8 @@ static int prepare_ls_row(struct osl_row *row, void *ls_opts)
        /* get the number of chars to print this amount of time */
        tmp = get_duration_width(d->afhi.seconds_total);
        w->duration_width = PARA_MAX(w->duration_width, tmp);
+       GET_NUM_DIGITS(d->afsi.amp, &num_digits);
+       w->amp_width = PARA_MAX(w->amp_width, num_digits);
        if (options->flags & LS_FLAG_ADMISSIBLE_ONLY) {
                GET_NUM_DIGITS(score, &num_digits);
                num_digits++; /* add one for the sign (space or "-") */
@@ -1908,11 +1920,13 @@ struct com_touch_options {
        int32_t num_played;
        /** New last played count. */
        int64_t last_played;
-       /** new lyrics id. */
+       /** New lyrics id. */
        int32_t lyrics_id;
-       /** new image id. */
+       /** New image id. */
        int32_t image_id;
-       /** command line flags (see \ref touch_flags). */
+       /** New amplification value. */
+       int32_t amp;
+       /** Command line flags (see \ref touch_flags). */
        unsigned flags;
 };
 
@@ -1933,7 +1947,7 @@ static int touch_audio_file(__a_unused struct osl_table *table,
        struct osl_object obj;
        struct afs_info old_afsi, new_afsi;
        int ret, no_options = tad->cto->num_played < 0 && tad->cto->last_played < 0 &&
-               tad->cto->lyrics_id < 0 && tad->cto->image_id < 0;
+               tad->cto->lyrics_id < 0 && tad->cto->image_id < 0 && tad->cto->amp < 0;
        struct afsi_change_event_data aced;
 
        ret = get_afsi_object_of_row(row, &obj);
@@ -1967,6 +1981,8 @@ static int touch_audio_file(__a_unused struct osl_table *table,
                        new_afsi.num_played = tad->cto->num_played;
                if (tad->cto->last_played >= 0)
                        new_afsi.last_played = tad->cto->last_played;
+               if (tad->cto->amp >= 0)
+                       new_afsi.amp = tad->cto->amp;
        }
        tad->num_matches++;
        save_afsi(&new_afsi, &obj); /* in-place update */
@@ -2014,7 +2030,8 @@ int com_touch(int fd, int argc, char * const * const argv)
                .num_played = -1,
                .last_played = -1,
                .lyrics_id = -1,
-               .image_id = -1
+               .image_id = -1,
+               .amp = -1,
        };
        struct osl_object query = {.data = &cto, .size = sizeof(cto)};
        int i, ret;
@@ -2052,6 +2069,16 @@ int com_touch(int fd, int argc, char * const * const argv)
                                return ret;
                        continue;
                }
+               if (!strncmp(arg, "-a", 2)) {
+                       int32_t val;
+                       ret = para_atoi32(arg + 2, &val);
+                       if (ret < 0)
+                               return ret;
+                       if (val < 0 || val > 255)
+                               return -ERRNO_TO_PARA_ERROR(EINVAL);
+                       cto.amp = val;
+                       continue;
+               }
                if (!strcmp(arg, "-p")) {
                        cto.flags |= TOUCH_FLAG_FNM_PATHNAME;
                        continue;
index 7afff93e263630da1a3692b7ca4b9f28c50fa973..f0ce62587d9c6fc995fe7c99440fa1238e706b49 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -66,6 +66,9 @@ struct audio_format_info {
 struct slot_info slot[MAX_STREAM_SLOTS];
 
 
+/** The array of status items sent by para_server. */
+char *stat_item_values[NUM_STAT_ITEMS] = {NULL};
+
 /**
  * the current mode of operation of which can be changed by the on/off/cycle
  * commands. It is either, AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY.
@@ -91,7 +94,7 @@ static struct status_task status_task_struct;
  *
  * \sa struct status_task
  */
-struct status_task *stat_task = &status_task_struct;
+static struct status_task *stat_task = &status_task_struct;
 static struct timeval initial_delay_barrier;
 
 /**
@@ -128,6 +131,55 @@ int get_audio_format_num(char *name)
        return -E_UNSUPPORTED_AUDIO_FORMAT;
 }
 
+char *get_time_string(struct timeval *newest_stime)
+{
+       struct timeval diff, adj_stream_start, tmp;
+       int total = 0, use_server_time = 1,
+               length_seconds = stat_task->length_seconds;
+
+       if (!stat_task->playing) {
+               if (length_seconds)
+                       return NULL;
+               return make_message("%s:\n", status_item_list[SI_PLAY_TIME]);
+       }
+       if (audiod_status == AUDIOD_OFF)
+               goto out;
+       if (stat_task->sa_time_diff_sign > 0)
+               tv_diff(&stat_task->server_stream_start, &stat_task->sa_time_diff,
+                       &adj_stream_start);
+       else
+               tv_add(&stat_task->server_stream_start, &stat_task->sa_time_diff,
+                       &adj_stream_start);
+       tmp = adj_stream_start;
+       if (newest_stime && audiod_status == AUDIOD_ON) {
+               tv_diff(newest_stime, &adj_stream_start, &diff);
+               if (tv2ms(&diff) < 5000) {
+                       tmp = *newest_stime;
+                       use_server_time = 0;
+               }
+       }
+       tv_diff(now, &tmp, &diff);
+       total = diff.tv_sec + stat_task->offset_seconds;
+       if (total > length_seconds)
+               total = length_seconds;
+       if (total < 0)
+               total = 0;
+out:
+       return make_message(
+               "%s: %s%d:%02d [%d:%02d] (%d%%/%d:%02d)\n",
+               status_item_list[SI_PLAY_TIME],
+               use_server_time? "~" : "",
+               total / 60,
+               total % 60,
+               (length_seconds - total) / 60,
+               (length_seconds - total) % 60,
+               length_seconds? (total * 100 + length_seconds / 2) /
+                       length_seconds : 0,
+               length_seconds / 60,
+               length_seconds % 60
+       );
+}
+
 /**
  * the log function of para_audiod
  *
@@ -467,8 +519,8 @@ static int check_stat_line(char *line, __a_unused void *data)
        tmp = make_message("%s\n", line);
        stat_client_write(tmp, itemnum);
        free(tmp);
-       free(stat_task->stat_item_values[itemnum]);
-       stat_task->stat_item_values[itemnum] = para_strdup(line);
+       free(stat_item_values[itemnum]);
+       stat_item_values[itemnum] = para_strdup(line);
        ilen = strlen(status_item_list[itemnum]);
        switch (itemnum) {
        case SI_STATUS:
@@ -814,18 +866,18 @@ static void close_stat_pipe(void)
        client_close(stat_task->ct);
        stat_task->ct = NULL;
        FOR_EACH_STATUS_ITEM(i) {
-               free(stat_task->stat_item_values[i]);
-               stat_task->stat_item_values[i] = NULL;
+               free(stat_item_values[i]);
+               stat_item_values[i] = NULL;
        }
        dump_empty_status();
        stat_task->length_seconds = 0;
        stat_task->offset_seconds = 0;
        audiod_status_dump();
        stat_task->playing = 0;
-       stat_task->stat_item_values[SI_BASENAME] = make_message(
+       stat_item_values[SI_BASENAME] = make_message(
                "%s: no connection to para_server\n",
                status_item_list[SI_BASENAME]);
-       stat_client_write(stat_task->stat_item_values[SI_BASENAME],
+       stat_client_write(stat_item_values[SI_BASENAME],
                SI_BASENAME);
 }
 
index f518a498324ce667aa2b1309f6a30bbb266d3b92..60de4caf8131368b8684f479f5f24db60fed156e 100644 (file)
--- a/audiod.h
+++ b/audiod.h
@@ -77,8 +77,6 @@ struct status_task {
        struct task task;
        /** client data associated with the stat task */
        struct client_task *ct;
-       /** the array of status items sent by para_server */
-       char *stat_item_values[NUM_STAT_ITEMS];
        /** do not restart client command until this time */
        struct timeval restart_barrier;
        /** last time we received status data from para_server */
@@ -103,7 +101,6 @@ struct status_task {
        int current_audio_format_num;
 };
 
-extern struct status_task *stat_task;
 extern struct slot_info slot[MAX_STREAM_SLOTS];
 extern struct audiod_args_info conf;
 extern int audiod_status;
@@ -112,6 +109,7 @@ void __noreturn clean_exit(int status, const char *msg);
 int handle_connect(int accept_fd);
 void audiod_status_dump(void);
 void dump_empty_status(void);
+char *get_time_string(struct timeval *newest_stime);
 
 /** iterate over all slots */
 #define FOR_EACH_SLOT(_slot) for (_slot = 0; _slot < MAX_STREAM_SLOTS; _slot++)
index b4c50dc86118a6d9f3c756f7d6b2c40a87c34ca9..fe8143ba928651e1aef5ccdb22d70e4200f0672f 100644 (file)
@@ -26,6 +26,9 @@
 #include "fd.h"
 #include "audiod_command_list.h"
 
+extern char *stat_item_values[NUM_STAT_ITEMS];
+
+
 /** iterate over the array of all audiod commands */
 #define FOR_EACH_COMMAND(c) for (c = 0; audiod_cmds[c].name; c++)
 
@@ -35,55 +38,6 @@ static int client_write(int fd, const char *buf)
        return write(fd, buf, len) != len? -E_CLIENT_WRITE: 1;
 }
 
-static char *get_time_string(struct timeval *newest_stime)
-{
-       struct timeval diff, adj_stream_start, tmp;
-       int total = 0, use_server_time = 1,
-               length_seconds = stat_task->length_seconds;
-
-       if (!stat_task->playing) {
-               if (length_seconds)
-                       return NULL;
-               return make_message("%s:\n", status_item_list[SI_PLAY_TIME]);
-       }
-       if (audiod_status == AUDIOD_OFF)
-               goto out;
-       if (stat_task->sa_time_diff_sign > 0)
-               tv_diff(&stat_task->server_stream_start, &stat_task->sa_time_diff,
-                       &adj_stream_start);
-       else
-               tv_add(&stat_task->server_stream_start, &stat_task->sa_time_diff,
-                       &adj_stream_start);
-       tmp = adj_stream_start;
-       if (newest_stime && audiod_status == AUDIOD_ON) {
-               tv_diff(newest_stime, &adj_stream_start, &diff);
-               if (tv2ms(&diff) < 5000) {
-                       tmp = *newest_stime;
-                       use_server_time = 0;
-               }
-       }
-       tv_diff(now, &tmp, &diff);
-       total = diff.tv_sec + stat_task->offset_seconds;
-       if (total > length_seconds)
-               total = length_seconds;
-       if (total < 0)
-               total = 0;
-out:
-       return make_message(
-               "%s: %s%d:%02d [%d:%02d] (%d%%/%d:%02d)\n",
-               status_item_list[SI_PLAY_TIME],
-               use_server_time? "~" : "",
-               total / 60,
-               total % 60,
-               (length_seconds - total) / 60,
-               (length_seconds - total) % 60,
-               length_seconds? (total * 100 + length_seconds / 2) /
-                       length_seconds : 0,
-               length_seconds / 60,
-               length_seconds % 60
-       );
-}
-
 __malloc static char *audiod_status_string(void)
 {
        const char *status = (audiod_status == AUDIOD_ON)?
@@ -263,7 +217,7 @@ int com_stat(int fd, __a_unused int argc, __a_unused char **argv)
                char *tmp, *v;
                if (!((1 << i) & mask))
                        continue;
-               v = stat_task->stat_item_values[i];
+               v = stat_item_values[i];
                tmp = make_message("%s%s%s", buf? buf: "",
                        v? v : "", v? "\n" : "");
                free(buf);
@@ -471,44 +425,44 @@ void audiod_status_dump(void)
        struct timeval *t = wstime();
        char *old, *new, *tmp;
 
-       old = stat_task->stat_item_values[SI_PLAY_TIME];
+       old = stat_item_values[SI_PLAY_TIME];
        new = get_time_string(t);
        if (new) {
                if (!old || strcmp(old, new)) {
                        free(old);
                        stat_client_write(new, SI_PLAY_TIME);
-                       stat_task->stat_item_values[SI_PLAY_TIME] = new;
+                       stat_item_values[SI_PLAY_TIME] = new;
                } else
                        free(new);
        }
 
        new = uptime_str();
-       old = stat_task->stat_item_values[SI_AUDIOD_UPTIME];
+       old = stat_item_values[SI_AUDIOD_UPTIME];
        if (!old || strcmp(old, new)) {
                free(old);
                tmp = make_message("%s: %s\n",
                        status_item_list[SI_AUDIOD_UPTIME], new);
                stat_client_write(tmp, SI_AUDIOD_UPTIME);
                free(tmp);
-               stat_task->stat_item_values[SI_AUDIOD_UPTIME] = new;
+               stat_item_values[SI_AUDIOD_UPTIME] = new;
        } else
                free(new);
 
-       old = stat_task->stat_item_values[SI_AUDIOD_STATUS];
+       old = stat_item_values[SI_AUDIOD_STATUS];
        new = audiod_status_string();
        if (!old || strcmp(old, new)) {
                free(old);
                stat_client_write(new, SI_AUDIOD_STATUS);
-               stat_task->stat_item_values[SI_AUDIOD_STATUS] = new;
+               stat_item_values[SI_AUDIOD_STATUS] = new;
        } else
                free(new);
 
-       old = stat_task->stat_item_values[SI_DECODER_FLAGS];
+       old = stat_item_values[SI_DECODER_FLAGS];
        new = decoder_flags();
        if (!old || strcmp(old, new)) {
                free(old);
                stat_client_write(new, SI_DECODER_FLAGS);
-               stat_task->stat_item_values[SI_DECODER_FLAGS] = new;
+               stat_item_values[SI_DECODER_FLAGS] = new;
        } else
                free(new);
 }
@@ -527,7 +481,7 @@ void dump_empty_status(void)
                char *tmp = make_message("%s:\n", status_item_list[i]);
                stat_client_write(tmp, i);
                free(tmp);
-               free(stat_task->stat_item_values[i]);
-               stat_task->stat_item_values[i] = NULL;
+               free(stat_item_values[i]);
+               stat_item_values[i] = NULL;
        }
 }
index a6c3d32a18990719f454c971a1ead2de46659e0e..8e2f07c9c4f3342e2984c5b4b8b2a0b047bb038c 100644 (file)
 #include "sched.h"
 #include "filter.h"
 #include "string.h"
+#include "audiod.h"
 
 /** The size of the output data buffer. */
 #define COMPRESS_CHUNK_SIZE 40960
 
+extern char *stat_item_values[NUM_STAT_ITEMS];
+
 /** Data specific to the compress filter. */
 struct private_compress_data {
        /** The current multiplier. */
@@ -32,6 +35,8 @@ struct private_compress_data {
        unsigned num_samples;
        /** Absolute value of the maximal sample in the current block. */
        unsigned peak;
+       /** Amplification factor. */
+       unsigned amp;
 };
 
 static ssize_t compress(char *inbuf, size_t inbuf_len, struct filter_node *fn)
@@ -47,10 +52,9 @@ static ssize_t compress(char *inbuf, size_t inbuf_len, struct filter_node *fn)
                return 0;
        for (i = 0; i < length / 2; i++) {
                /* be careful in that heat, my dear */
-               int sample = *ip++, adjusted_sample;
+               int sample = *ip++, adjusted_sample = (PARA_ABS(sample) * (64 + pcd->amp)) >> 6;
 
-               adjusted_sample = (PARA_ABS(sample) * pcd->current_gain)
-                       >> gain_shift;
+               adjusted_sample = (adjusted_sample * pcd->current_gain) >> gain_shift;
                if (unlikely(adjusted_sample > 32767)) { /* clip */
                        PARA_NOTICE_LOG("clip: sample: %d, adjusted sample: %d\n",
                                sample, adjusted_sample);
@@ -102,6 +106,13 @@ 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);
+       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);
 }
 
 /**
index 592adfe2c40a4fd5ad02675b63f5bd05c1ba9f99..79d930de1c7fdaecfdef3d817bd6875c75748239 100644 (file)
@@ -616,7 +616,7 @@ status_flags format score audio_file_info taginfo1 taginfo2 afs_mode
 attributes_txt decoder_flags audiod_status play_time attributes_bitmap
 offset seconds_total stream_start current_time audiod_uptime image_id
 lyrics_id duration directory lyrics_name image_name path hash channels
-last_played num_chunks chunk_time"
+last_played num_chunks chunk_time amplification"
 
 # $1: prefix, $2: items
 AC_DEFUN([make_enum_items], [$(
index 939f9b56501f99cdeb4fa11695cb1c49c0e3e5c0..09b644151a3cf4b8f081bf42743224b28a6829dd 100644 (file)
--- a/filter.c
+++ b/filter.c
 #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. */
 INIT_FILTER_ERRLISTS;
 
diff --git a/score.c b/score.c
index 0e18a1b994eb72025619efaecabe05d544f85765..f2a28b7559bd49308559262fa3d475d041cab88f 100644 (file)
--- a/score.c
+++ b/score.c
@@ -182,6 +182,8 @@ int score_update(const struct osl_row *aft_row, long percent)
                .size = sizeof(aft_row)};
        int ret = osl_get_row(score_table, SCORECOL_AFT_ROW, &obj, &row);
 
+       if (ret == -E_RB_KEY_NOT_FOUND) /* not an error */
+               return 1;
        if (ret < 0)
                return ret;
        ret = get_num_admissible_files(&n);