[btr]: Minor improvements and cleanups.
authorAndre Noll <maan@systemlinux.org>
Tue, 29 Dec 2009 21:51:29 +0000 (22:51 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 29 Dec 2009 21:51:29 +0000 (22:51 +0100)
alsa_write.c
write.c
write.h

index 030a5ec..f8c192b 100644 (file)
@@ -218,9 +218,8 @@ static int alsa_write_pre_select(struct sched *s, struct writer_node *wn)
                return 1;
        if (conf->buffer_tree_given) {
                size_t sz = btr_get_input_queue_size(wn->btrn);
-               //PARA_CRIT_LOG("input queue: %zu\n", sz);
-               //if (sz < pad->bytes_per_frame)
-               //      return 1;
+               if (sz < pad->bytes_per_frame)
+                       return 1;
        } else {
                if (*wng->loaded - wn->written < pad->bytes_per_frame)
                        return 1;
diff --git a/write.c b/write.c
index 21a0dad..818175a 100644 (file)
--- a/write.c
+++ b/write.c
@@ -190,20 +190,21 @@ static int main_btr(struct sched *s)
        struct writer *w = writers + DEFAULT_WRITER;
        int ret;
 
-       wn->writer_num = DEFAULT_WRITER;
-       wn->conf = writers[DEFAULT_WRITER].parse_config("-B");
        sit.btrn = btr_new_node("stdin", NULL /* stdin has no parent */, NULL);
        stdin_set_defaults(&sit);
        register_task(&sit.task);
 
+       wn->writer_num = DEFAULT_WRITER;
+       wn->conf = writers[DEFAULT_WRITER].parse_config("-B");
        wn->btrn = btr_new_node("writer", sit.btrn, NULL);
-
        sprintf(wn->task.status, "some writer");
        w->open(wn);
        wn->task.post_select = w->post_select_btr;
        wn->task.pre_select = w->pre_select_btr;
        register_task(&wn->task);
 
+
+
        s->default_timeout.tv_sec = 10;
        s->default_timeout.tv_usec = 50000;
        ret = schedule(s);
diff --git a/write.h b/write.h
index b47784a..66f21cf 100644 (file)
--- a/write.h
+++ b/write.h
@@ -24,7 +24,7 @@ struct writer_node {
        /** How much of the wng's buffer is already written. */
        size_t written;
        struct btr_node *btrn;
-       struct task task; /* move this to btr as btr nodes do not make sense w/o task */
+       struct task task;
 };
 
 /** Describes one supported writer. */