output_plugin: don't pass audio_output object to method init()

audio_output_get_name() has been removed, which was the only function
left in output_api.h.  The output plugin doesn't need the audio_output
object at all, remove the parameter from the init() method.
This commit is contained in:
Max Kellermann 2009-02-25 18:34:02 +01:00
parent 0cf4f09e4f
commit dcd84c19cd
12 changed files with 19 additions and 34 deletions

View File

@ -129,8 +129,7 @@ alsa_configure(struct alsa_data *ad, const struct config_param *param)
}
static void *
alsa_init(G_GNUC_UNUSED struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
alsa_init(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
/* no need for pthread_once thread-safety when reading config */

View File

@ -75,8 +75,7 @@ static void audioOutputAo_error(const char *msg)
}
static void *
audioOutputAo_initDriver(G_GNUC_UNUSED struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
audioOutputAo_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
ao_info *ai;

View File

@ -159,9 +159,9 @@ static bool openFifo(FifoData *fd)
return true;
}
static void *fifo_initDriver(G_GNUC_UNUSED struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
static void *
fifo_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
FifoData *fd;
char *value, *path;

View File

@ -157,8 +157,7 @@ mpd_jack_info(const char *msg)
#endif
static void *
mpd_jack_init(G_GNUC_UNUSED struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
struct jack_data *jd;

View File

@ -70,7 +70,6 @@ typedef struct {
#define MVP_GET_AUD_REGS _IOW('a',28,aud_ctl_regs_t*)
typedef struct _MvpData {
struct audio_output *audio_output;
struct audio_format audio_format;
int fd;
} MvpData;
@ -110,12 +109,11 @@ static bool mvp_testDefault(void)
return false;
}
static void *mvp_initDriver(G_GNUC_UNUSED struct audio_output *audio_output,
G_GNUC_UNUSED const struct audio_format *audio_format,
G_GNUC_UNUSED const struct config_param *param)
static void *
mvp_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
G_GNUC_UNUSED const struct config_param *param)
{
MvpData *md = g_new(MvpData, 1);
md->audio_output = audio_output;
md->fd = -1;
return md;

View File

@ -30,8 +30,7 @@ struct null_data {
};
static void *
null_init(G_GNUC_UNUSED struct audio_output *audio_output,
G_GNUC_UNUSED const struct audio_format *audio_format,
null_init(G_GNUC_UNUSED const struct audio_format *audio_format,
G_GNUC_UNUSED const struct config_param *param)
{
struct null_data *nd = g_new(struct null_data, 1);

View File

@ -388,8 +388,7 @@ static void *oss_open_default(const struct config_param *param)
}
static void *
oss_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
G_GNUC_UNUSED const struct audio_format *audio_format,
oss_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
const char *device = config_get_block_string(param, "device", NULL);

View File

@ -80,8 +80,7 @@ static bool osx_testDefault(void)
}
static void *
osx_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
G_GNUC_UNUSED const struct audio_format *audio_format,
osx_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
G_GNUC_UNUSED const struct config_param *param)
{
return newOsxData();

View File

@ -53,8 +53,7 @@ static void pulse_free_data(struct pulse_data *pd)
}
static void *
pulse_init(G_GNUC_UNUSED struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
pulse_init(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
struct pulse_data *pd;

View File

@ -38,8 +38,6 @@ struct shout_buffer {
};
struct shout_data {
struct audio_output *audio_output;
shout_t *shout_conn;
shout_metadata_t *shout_meta;
@ -97,9 +95,9 @@ static void free_shout_data(struct shout_data *sd)
} \
}
static void *my_shout_init_driver(struct audio_output *audio_output,
const struct audio_format *audio_format,
const struct config_param *param)
static void *
my_shout_init_driver(const struct audio_format *audio_format,
const struct config_param *param)
{
struct shout_data *sd;
char *test;
@ -119,7 +117,6 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
int public;
sd = new_shout_data();
sd->audio_output = audio_output;
if (shout_init_count == 0)
shout_init();

View File

@ -109,7 +109,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param)
notify_init(&ao->notify);
ao->command = AO_COMMAND_NONE;
ao->data = ao_plugin_init(plugin, ao,
ao->data = ao_plugin_init(plugin,
format ? &ao->config_audio_format : NULL,
param);
if (ao->data == NULL)

View File

@ -22,7 +22,6 @@
#include <stdbool.h>
#include <stddef.h>
struct audio_output;
struct config_param;
struct audio_format;
struct tag;
@ -54,8 +53,7 @@ struct audio_output_plugin {
* @return NULL on error, or an opaque pointer to the plugin's
* data
*/
void *(*init)(struct audio_output *ao,
const struct audio_format *audio_format,
void *(*init)(const struct audio_format *audio_format,
const struct config_param *param);
/**
@ -127,11 +125,10 @@ ao_plugin_test_default_device(const struct audio_output_plugin *plugin)
static inline void *
ao_plugin_init(const struct audio_output_plugin *plugin,
struct audio_output *ao,
const struct audio_format *audio_format,
const struct config_param *param)
{
return plugin->init(ao, audio_format, param);
return plugin->init(audio_format, param);
}
static inline void