aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/pulse_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-25 17:32:58 +0100
committerMax Kellermann <max@duempel.org>2009-02-25 17:32:58 +0100
commit0cf4f09e4ffb4866eba5c4055fabfe1e60c780e4 (patch)
treebffb8f2c37f494233428bf51b5b8e98e23144c98 /src/output/pulse_plugin.c
parent4726c7f709af4d0998b042fa74e1860953898458 (diff)
downloadmpd-0cf4f09e4ffb4866eba5c4055fabfe1e60c780e4.tar.gz
mpd-0cf4f09e4ffb4866eba5c4055fabfe1e60c780e4.tar.xz
mpd-0cf4f09e4ffb4866eba5c4055fabfe1e60c780e4.zip
output_api: removed audio_output_get_name()
Use config_get_block_string("name") instead of audio_output_get_name().
Diffstat (limited to 'src/output/pulse_plugin.c')
-rw-r--r--src/output/pulse_plugin.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/output/pulse_plugin.c b/src/output/pulse_plugin.c
index b969f3500..9fd8d6d9c 100644
--- a/src/output/pulse_plugin.c
+++ b/src/output/pulse_plugin.c
@@ -25,7 +25,7 @@
#define MPD_PULSE_NAME "mpd"
struct pulse_data {
- struct audio_output *ao;
+ const char *name;
pa_simple *s;
char *server;
@@ -53,14 +53,14 @@ static void pulse_free_data(struct pulse_data *pd)
}
static void *
-pulse_init(struct audio_output *ao,
+pulse_init(G_GNUC_UNUSED struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param)
{
struct pulse_data *pd;
pd = pulse_new_data();
- pd->ao = ao;
+ pd->name = config_get_block_string(param, "name", "mpd_pulse");
pd->server = param != NULL
? config_dup_block_string(param, "server", NULL) : NULL;
pd->sink = param != NULL
@@ -115,20 +115,19 @@ pulse_open(void *data, struct audio_format *audio_format)
ss.channels = audio_format->channels;
pd->s = pa_simple_new(pd->server, MPD_PULSE_NAME, PA_STREAM_PLAYBACK,
- pd->sink, audio_output_get_name(pd->ao),
+ pd->sink, pd->name,
&ss, NULL, NULL,
&error);
if (!pd->s) {
g_warning("Cannot connect to server in PulseAudio output "
"\"%s\": %s\n",
- audio_output_get_name(pd->ao),
- pa_strerror(error));
+ pd->name, pa_strerror(error));
return false;
}
g_debug("PulseAudio output \"%s\" connected and playing %i bit, %i "
"channel audio at %i Hz\n",
- audio_output_get_name(pd->ao),
+ pd->name,
audio_format->bits,
audio_format->channels, audio_format->sample_rate);
@@ -145,8 +144,7 @@ static void pulse_cancel(void *data)
if (pa_simple_flush(pd->s, &error) < 0)
g_warning("Flush failed in PulseAudio output \"%s\": %s\n",
- audio_output_get_name(pd->ao),
- pa_strerror(error));
+ pd->name, pa_strerror(error));
}
static void pulse_close(void *data)
@@ -169,8 +167,7 @@ pulse_play(void *data, const void *chunk, size_t size)
if (pa_simple_write(pd->s, chunk, size, &error) < 0) {
g_warning("PulseAudio output \"%s\" disconnecting due to "
"write error: %s\n",
- audio_output_get_name(pd->ao),
- pa_strerror(error));
+ pd->name, pa_strerror(error));
pulse_close(pd);
return 0;
}