summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao.c5
-rw-r--r--audio/out/ao.h16
-rw-r--r--audio/out/ao_alsa.c2
-rw-r--r--audio/out/ao_coreaudio.c2
-rw-r--r--audio/out/ao_dsound.c2
-rw-r--r--audio/out/ao_jack.c2
-rw-r--r--audio/out/ao_lavc.c2
-rw-r--r--audio/out/ao_null.c2
-rw-r--r--audio/out/ao_openal.c2
-rw-r--r--audio/out/ao_oss.c2
-rw-r--r--audio/out/ao_pcm.c2
-rw-r--r--audio/out/ao_portaudio.c2
-rw-r--r--audio/out/ao_pulse.c2
-rw-r--r--audio/out/ao_rsound.c2
-rw-r--r--audio/out/ao_sdl.c2
-rw-r--r--audio/out/ao_wasapi.c2
16 files changed, 18 insertions, 31 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index c7fd60a8f8..04e6fcda12 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -146,9 +146,10 @@ static struct ao *ao_create(bool probing, struct MPOpts *opts,
if (ao->driver->encode != !!ao->encode_lavc_ctx)
goto error;
struct m_config *config = m_config_from_obj_desc(ao, &desc);
- if (m_config_initialize_obj(config, &desc, &ao->priv, &args) < 0)
+ if (m_config_set_obj_params(config, args) < 0)
goto error;
- if (ao->driver->init(ao, (char *)args) < 0)
+ ao->priv = config->optstruct;
+ if (ao->driver->init(ao) < 0)
goto error;
ao->bps = ao->channels.num * ao->samplerate * af_fmt2bits(ao->format) / 8;
return ao;
diff --git a/audio/out/ao.h b/audio/out/ao.h
index 4556958324..25cd12a0f1 100644
--- a/audio/out/ao.h
+++ b/audio/out/ao.h
@@ -54,27 +54,13 @@ typedef struct ao_info {
const char *comment;
} ao_info_t;
-/* interface towards mplayer and */
-typedef struct ao_old_functions {
- int (*control)(int cmd, void *arg);
- int (*init)(int rate, const struct mp_chmap *channels, int format, int flags);
- void (*uninit)(int immed);
- void (*reset)(void);
- int (*get_space)(void);
- int (*play)(void *data, int len, int flags);
- float (*get_delay)(void);
- void (*pause)(void);
- void (*resume)(void);
-} ao_functions_t;
-
struct ao;
struct ao_driver {
bool encode;
const struct ao_info *info;
- const struct ao_old_functions *old_functions;
int (*control)(struct ao *ao, enum aocontrol cmd, void *arg);
- int (*init)(struct ao *ao, char *params);
+ int (*init)(struct ao *ao);
void (*uninit)(struct ao *ao, bool cut_audio);
void (*reset)(struct ao*ao);
int (*get_space)(struct ao *ao);
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 8c70ff39c0..9b1c32181d 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -361,7 +361,7 @@ static int try_open_device(struct ao *ao, const char *device, int open_mode,
open & setup audio device
return: 0=success -1=fail
*/
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
int err;
snd_pcm_uframes_t chunk_size;
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index e1a8e58cd4..718c71187d 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -228,7 +228,7 @@ coreaudio_error:
static int init_lpcm(struct ao *ao, AudioStreamBasicDescription asbd);
static int init_digital(struct ao *ao, AudioStreamBasicDescription asbd);
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
OSStatus err;
struct priv *p = ao->priv;
diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c
index b07facc948..4e85460243 100644
--- a/audio/out/ao_dsound.c
+++ b/audio/out/ao_dsound.c
@@ -391,7 +391,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
\param flags unused
\return 0=success -1=fail
*/
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *p = ao->priv;
int res;
diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c
index 3f1af8482a..ba855cce23 100644
--- a/audio/out/ao_jack.c
+++ b/audio/out/ao_jack.c
@@ -164,7 +164,7 @@ static int outputaudio(jack_nframes_t nframes, void *arg)
return 0;
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *p = ao->priv;
const char **matching_ports = NULL;
diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c
index 4fe709ce9a..e72c6c903d 100644
--- a/audio/out/ao_lavc.c
+++ b/audio/out/ao_lavc.c
@@ -64,7 +64,7 @@ struct priv {
};
// open & setup audio device
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *ac = talloc_zero(ao, struct priv);
const enum AVSampleFormat *sampleformat;
diff --git a/audio/out/ao_null.c b/audio/out/ao_null.c
index dde2102daa..ba0f61ce34 100644
--- a/audio/out/ao_null.c
+++ b/audio/out/ao_null.c
@@ -46,7 +46,7 @@ static void drain(struct ao *ao)
priv->last_time = now;
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *priv = talloc_zero(ao, struct priv);
ao->priv = priv;
diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c
index 27a8093d36..ccc73ba9f5 100644
--- a/audio/out/ao_openal.c
+++ b/audio/out/ao_openal.c
@@ -116,7 +116,7 @@ static const struct speaker speaker_pos[] = {
{-1},
};
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
float position[3] = {0, 0, 0};
float direction[6] = {0, 0, 1, 0, -1, 0};
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c
index b50c3efe3a..08d80bf7fd 100644
--- a/audio/out/ao_oss.c
+++ b/audio/out/ao_oss.c
@@ -195,7 +195,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
// open & setup audio device
// return: 0=success -1=fail
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *p = ao->priv;
int oss_format;
diff --git a/audio/out/ao_pcm.c b/audio/out/ao_pcm.c
index cbfe4d4640..2b6a89e78b 100644
--- a/audio/out/ao_pcm.c
+++ b/audio/out/ao_pcm.c
@@ -109,7 +109,7 @@ static void write_wave_header(struct ao *ao, FILE *fp, uint64_t data_length)
fput32le(data_length, fp);
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *priv = ao->priv;
diff --git a/audio/out/ao_portaudio.c b/audio/out/ao_portaudio.c
index d695a16550..ea8d8f3e88 100644
--- a/audio/out/ao_portaudio.c
+++ b/audio/out/ao_portaudio.c
@@ -214,7 +214,7 @@ static void uninit(struct ao *ao, bool cut_audio)
Pa_Terminate();
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *priv = ao->priv;
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c
index 0f31e7996c..382a4d2dcc 100644
--- a/audio/out/ao_pulse.c
+++ b/audio/out/ao_pulse.c
@@ -228,7 +228,7 @@ static void uninit(struct ao *ao, bool cut_audio)
}
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct pa_sample_spec ss;
struct pa_channel_map map;
diff --git a/audio/out/ao_rsound.c b/audio/out/ao_rsound.c
index c23010bf80..db89ad52c6 100644
--- a/audio/out/ao_rsound.c
+++ b/audio/out/ao_rsound.c
@@ -90,7 +90,7 @@ static int set_format(struct ao *ao)
return rsd_format;
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
struct priv *priv = ao->priv;
diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c
index 93f5431679..b5368066d8 100644
--- a/audio/out/ao_sdl.c
+++ b/audio/out/ao_sdl.c
@@ -121,7 +121,7 @@ static unsigned int ceil_power_of_two(unsigned int x)
return y;
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
if (SDL_WasInit(SDL_INIT_AUDIO)) {
mp_msg(MSGT_AO, MSGL_ERR, "[sdl] already initialized\n");
diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c
index d5a89ca587..33c4c3b7ea 100644
--- a/audio/out/ao_wasapi.c
+++ b/audio/out/ao_wasapi.c
@@ -1225,7 +1225,7 @@ static void uninit(struct ao *ao, bool immed)
mp_msg(MSGT_AO, MSGL_V, "ao-wasapi: uninit END!\n");
}
-static int init(struct ao *ao, char *params)
+static int init(struct ao *ao)
{
mp_msg(MSGT_AO, MSGL_V, "ao-wasapi: init!\n");
struct mp_chmap_sel sel = {0};