From: Andre Noll Date: Sun, 15 Mar 2009 16:14:50 +0000 (+0100) Subject: write: Get rid of wn->chunk_bytes and wng->max_chunk_bytes. X-Git-Tag: v0.3.4~34 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=4213f76d961629c7996c9d8c95171197f963e2f4;p=paraslash.git write: Get rid of wn->chunk_bytes and wng->max_chunk_bytes. These are not used anyway. Make all writers return 1 on success. --- diff --git a/alsa_write.c b/alsa_write.c index d65cfb4d..dfd2421d 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -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) diff --git a/file_write.c b/file_write.c index 016732ae..0950e303 100644 --- a/file_write.c +++ b/file_write.c @@ -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 fc6ade3c..71938a9c 100644 --- 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. */ diff --git a/write_common.c b/write_common.c index 8133577b..4e81f62d 100644 --- a/write_common.c +++ b/write_common.c @@ -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);