writers: Kill ->open.
authorAndre Noll <maan@systemlinux.org>
Sat, 6 Nov 2010 10:48:12 +0000 (11:48 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 23 Nov 2010 16:43:08 +0000 (17:43 +0100)
Now that ->open is a dummy function for all writers, we may safely remove
this method from struct writer and kill the dummy functions.

alsa_write.c
file_write.c
oss_write.c
osx_write.c
write.h
write_common.c

index 0bad219..8676a45 100644 (file)
@@ -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;
index 149b48e..7762d79 100644 (file)
@@ -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;
index 80777ea..090f990 100644 (file)
@@ -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;
index 507ad91..ebfa4b3 100644 (file)
@@ -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 da6f1e7..d5834b4 100644 (file)
--- 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.
         *
index 5bfba37..be7f9c2 100644 (file)
@@ -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);