From: Andre Noll Date: Sat, 6 Nov 2010 10:48:12 +0000 (+0100) Subject: writers: Kill ->open. X-Git-Tag: v0.4.5~4^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c1b587842e553665fbffce079a5ff5a69c9c6a38;p=paraslash.git writers: Kill ->open. Now that ->open is a dummy function for all writers, we may safely remove this method from struct writer and kill the dummy functions. --- diff --git a/alsa_write.c b/alsa_write.c index 0bad2199..8676a451 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -35,7 +35,7 @@ struct private_alsa_write_data { /** The alsa handle */ snd_pcm_t *handle; - /** Determined and set by alsa_open(). */ + /** Determined and set by alsa_init(). */ int bytes_per_frame; /** The approximate maximum buffer duration in us. */ unsigned buffer_time; @@ -142,11 +142,6 @@ static int alsa_init(struct private_alsa_write_data *pad, return 1; } -/* Open an instance of the alsa writer. */ -static void alsa_open(__a_unused struct writer_node *wn) -{ -} - static void alsa_write_pre_select(struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); @@ -303,7 +298,6 @@ void alsa_write_init(struct writer *w) struct alsa_write_args_info dummy; alsa_cmdline_parser_init(&dummy); - w->open = alsa_open; w->close = alsa_close; w->pre_select = alsa_write_pre_select; w->post_select = alsa_write_post_select; diff --git a/file_write.c b/file_write.c index 149b48ef..7762d794 100644 --- a/file_write.c +++ b/file_write.c @@ -50,10 +50,6 @@ __must_check __malloc static char *random_filename(void) return result; } -static void file_write_open(__a_unused struct writer_node *wn) -{ -} - static int prepare_output_file(struct writer_node *wn) { struct file_write_args_info *conf = wn->conf; @@ -159,7 +155,6 @@ void file_write_init(struct writer *w) struct file_write_args_info dummy; file_cmdline_parser_init(&dummy); - w->open = file_write_open; w->pre_select = file_write_pre_select; w->post_select = file_write_post_select; w->parse_config_or_die = file_write_parse_config_or_die; diff --git a/oss_write.c b/oss_write.c index 80777ea1..090f9905 100644 --- a/oss_write.c +++ b/oss_write.c @@ -202,10 +202,6 @@ out: btr_remove_node(btrn); } -static void oss_open(__a_unused struct writer_node *wn) -{ -} - __malloc static void *oss_parse_config_or_die(const char *options) { struct oss_write_args_info *conf = para_calloc(sizeof(*conf)); @@ -232,7 +228,6 @@ void oss_write_init(struct writer *w) struct oss_write_args_info dummy; oss_cmdline_parser_init(&dummy); - w->open = oss_open; w->close = oss_close; w->pre_select = oss_pre_select; w->post_select = oss_post_select; diff --git a/osx_write.c b/osx_write.c index 507ad912..ebfa4b3c 100644 --- a/osx_write.c +++ b/osx_write.c @@ -187,10 +187,6 @@ static OSStatus osx_callback(void * inClientData, #define ENDIAN_FLAGS 0 #endif -static void osx_write_open(__a_unused struct writer_node *wn) -{ -} - static int core_audio_init(struct writer_node *wn) { struct private_osx_write_data *powd = para_calloc(sizeof(*powd)); @@ -371,7 +367,6 @@ void osx_write_init(struct writer *w) struct osx_write_args_info dummy; osx_cmdline_parser_init(&dummy); - w->open = osx_write_open; w->close = osx_write_close; w->pre_select = osx_write_pre_select; w->post_select = osx_write_post_select; diff --git a/write.h b/write.h index da6f1e75..d5834b4c 100644 --- a/write.h +++ b/write.h @@ -50,16 +50,6 @@ struct writer { * This should free whatever was allocated by \ref parse_config_or_die(). */ void (*free_config)(void *config); - /** - * Open one instance of this writer. - * - * Perform any preparations needed to write the incoming stream. - * Usually this function just allocates its private data structure and - * stores a pointer to that structure in the ->private data of the - * given parameter. This function must either succeed or terminate the - * process. - */ - void (*open)(struct writer_node *); /** * Prepare the fd sets for select. * diff --git a/write_common.c b/write_common.c index 5bfba37d..be7f9c22 100644 --- a/write_common.c +++ b/write_common.c @@ -92,7 +92,6 @@ void register_writer_node(struct writer_node *wn, struct btr_node *parent) .handler = w->execute, .context = wn)); strcpy(wn->task.status, name); free(name); - w->open(wn); wn->task.post_select = w->post_select; wn->task.pre_select = w->pre_select; register_task(&wn->task);