write: Get rid of wn->chunk_bytes and wng->max_chunk_bytes.
authorAndre Noll <maan@systemlinux.org>
Sun, 15 Mar 2009 16:14:50 +0000 (17:14 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 15 Mar 2009 16:14:50 +0000 (17:14 +0100)
These are not used anyway. Make all writers return 1 on success.

alsa_write.c
file_write.c
write.h
write_common.c

index d65cfb4..dfd2421 100644 (file)
@@ -134,7 +134,7 @@ static int alsa_open(struct writer_node *w)
        if (snd_pcm_nonblock(pad->handle, 1))
                PARA_ERROR_LOG("failed to set nonblock mode\n");
        tv_add(now, &(struct timeval ){0, 100 * 1000}, &pad->next_chunk);
-       return period_size * pad->bytes_per_frame;
+       return 1;
 }
 
 static int alsa_write_pre_select(struct sched *s, struct writer_node *wn)
index 016732a..0950e30 100644 (file)
@@ -46,7 +46,7 @@ static int file_write_open(struct writer_node *wn)
        if (!conf->filename_given)
                free(filename);
        if (pfwd->fd >= 0)
-               return 8192;
+               return 1;
        free(pfwd);
        return -E_FW_OPEN;
 }
diff --git a/write.h b/write.h
index fc6ade3..71938a9 100644 (file)
--- a/write.h
+++ b/write.h
@@ -17,8 +17,6 @@ struct writer_node {
        struct writer *writer; /* FIXME: Should better be only the number. */
        /** Writer-specific data. */
        void *private_data;
-       /** Send that many bytes in one go. */
-       int chunk_bytes;
        /** Pointer to the group this node belongs to. */
        struct writer_node_group *wng;
        /** The writer-specific configuration of this node. */
@@ -95,8 +93,6 @@ struct writer_node_group {
        unsigned num_writers;
        /** Array of pointers to the corresponding writer nodes. */
        struct writer_node *writer_nodes;
-       /** The maximum of the chunk_bytes values of the writer nodes in this group. */
-       int max_chunk_bytes;
        /** Non-zero if an error or end of file was encountered by the feeding task. */
        int *input_error;
        /** Current output buffer. */
index 8133577..4e81f62 100644 (file)
@@ -86,8 +86,6 @@ int wng_open(struct writer_node_group *g)
                ret = wn->writer->open(wn);
                if (ret < 0)
                        goto err_out;
-               wn->chunk_bytes = ret;
-               g->max_chunk_bytes = PARA_MAX(g->max_chunk_bytes, ret);
        }
        sprintf(g->task.status, "%s", "writer node group");
        register_task(&g->task);