]> git.tue.mpg.de Git - paraslash.git/commitdiff
[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 030a5ec60e740ce7a3fe11ad82e72f50d9de4095..f8c192b7df7daf3fc6283854e885da8a33e52f32 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 21a0dad9253e66877ada6da5814062764d1269fb..818175a4ebb56117e58843844edca6b092cced48 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 b47784af8785f2df6481cd1d3c23f517d6697adc..66f21cfe6e8256f088a1c9246a9b72b13a49b134 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. */