Merge branch 'master' into next
[paraslash.git] / audiod.c
index 32c839411b138406ab4bb760f8b8b9b873c1305d..0479e1e132c6b6e8d9fceb110f97bd98ed6d8381 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -386,8 +386,8 @@ static void open_filters(int slot_num)
        s->fc->inbufp = &s->receiver_node->buf;
        s->fc->in_loaded = &s->receiver_node->loaded;
        s->fc->input_error = &s->receiver_node->task.error;
-       s->fc->task.pre_select = filter_pre_select;
-       s->fc->task.post_select = NULL;
+       s->fc->task.pre_select = NULL;
+       s->fc->task.post_select = filter_post_select;
        s->fc->task.error = 0;
        s->fc->num_filters = nf;
 
@@ -902,8 +902,15 @@ static void command_post_select(struct sched *s, struct task *t)
 {
        int ret;
        struct command_task *ct = container_of(t, struct command_task, task);
+       static struct timeval last_status_dump;
+       struct timeval tmp;
+
+       tv_add(&last_status_dump, &(struct timeval){0, 500 * 1000}, &tmp);
+       if (tv_diff(&tmp, now, NULL) < 0) {
+               audiod_status_dump();
+               last_status_dump = *now;
+       }
 
-       audiod_status_dump();
        if (!FD_ISSET(ct->fd, &s->rfds))
                return;
        ret = handle_connect(ct->fd);
@@ -1227,7 +1234,7 @@ int main(int argc, char *argv[])
        register_task(&cmd_task->task);
        register_task(&stat_task->task);
        s.default_timeout.tv_sec = 0;
-       s.default_timeout.tv_usec = 99 * 1000;
+       s.default_timeout.tv_usec = 999 * 1000;
        ret = schedule(&s);
 
        PARA_EMERG_LOG("%s\n", para_strerror(-ret));