]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 0bad21992c2537f41201a36499b5cf9129b0255e..8676a451a85fd36edf1625d651a22ddfd3436537 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 149b48efcc38afe4b3f72aca2eecc6b5364001cc..7762d7940754a3b044917107205d34c610c65cde 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 80777ea1e616f0b9a14bbcab89e790fac14cb5b9..090f990565ce10b7eb85bd8dde2c391c132797c4 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 507ad912d8c929c9e62b3a7ca02f9ba6a44315b6..ebfa4b3c858d428a7c001e0fdae8e0dd717161a0 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 da6f1e75aabfe2ceac26e9d4c7074e243b9829c9..d5834b4c436eafae77cb7a086c045c4bf6f0a81b 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 5bfba37d9197b7910046fa9efd6685167166164b..be7f9c221f5bda21b5b7cb79db02ec8f748a3102 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);