aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output_thread.c')
-rw-r--r--src/output_thread.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index bf56ca971..e194edc92 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -29,6 +29,7 @@
#include "filter/convert_filter_plugin.h"
#include "filter/replay_gain_filter_plugin.h"
#include "mpd_error.h"
+#include "notify.h"
#include <glib.h>
@@ -59,7 +60,7 @@ ao_enable(struct audio_output *ao)
return true;
g_mutex_unlock(ao->mutex);
- success = ao_plugin_enable(ao->plugin, ao->data, &error);
+ success = ao_plugin_enable(ao, &error);
g_mutex_lock(ao->mutex);
if (!success) {
g_warning("Failed to enable \"%s\" [%s]: %s\n",
@@ -85,7 +86,7 @@ ao_disable(struct audio_output *ao)
ao->really_enabled = false;
g_mutex_unlock(ao->mutex);
- ao_plugin_disable(ao->plugin, ao->data);
+ ao_plugin_disable(ao);
g_mutex_lock(ao->mutex);
}
}
@@ -174,9 +175,7 @@ ao_open(struct audio_output *ao)
&ao->config_audio_format);
g_mutex_unlock(ao->mutex);
- success = ao_plugin_open(ao->plugin, ao->data,
- &ao->out_audio_format,
- &error);
+ success = ao_plugin_open(ao, &ao->out_audio_format, &error);
g_mutex_lock(ao->mutex);
assert(!ao->open);
@@ -220,11 +219,11 @@ ao_close(struct audio_output *ao, bool drain)
g_mutex_unlock(ao->mutex);
if (drain)
- ao_plugin_drain(ao->plugin, ao->data);
+ ao_plugin_drain(ao);
else
- ao_plugin_cancel(ao->plugin, ao->data);
+ ao_plugin_cancel(ao);
- ao_plugin_close(ao->plugin, ao->data);
+ ao_plugin_close(ao);
ao_filter_close(ao);
g_mutex_lock(ao->mutex);
@@ -256,7 +255,7 @@ ao_reopen_filter(struct audio_output *ao)
ao->fail_timer = g_timer_new();
g_mutex_unlock(ao->mutex);
- ao_plugin_close(ao->plugin, ao->data);
+ ao_plugin_close(ao);
g_mutex_lock(ao->mutex);
return;
@@ -301,7 +300,7 @@ static bool
ao_wait(struct audio_output *ao)
{
while (true) {
- unsigned delay = ao_plugin_delay(ao->plugin, ao->data);
+ unsigned delay = ao_plugin_delay(ao);
if (delay == 0)
return true;
@@ -433,7 +432,7 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
if (chunk->tag != NULL) {
g_mutex_unlock(ao->mutex);
- ao_plugin_send_tag(ao->plugin, ao->data, chunk->tag);
+ ao_plugin_send_tag(ao, chunk->tag);
g_mutex_lock(ao->mutex);
}
@@ -455,8 +454,7 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
break;
g_mutex_unlock(ao->mutex);
- nbytes = ao_plugin_play(ao->plugin, ao->data, data, size,
- &error);
+ nbytes = ao_plugin_play(ao, data, size, &error);
g_mutex_lock(ao->mutex);
if (nbytes == 0) {
/* play()==0 means failure */
@@ -535,7 +533,7 @@ ao_play(struct audio_output *ao)
ao->chunk_finished = true;
g_mutex_unlock(ao->mutex);
- player_lock_signal();
+ player_lock_signal(ao->player_control);
g_mutex_lock(ao->mutex);
return true;
@@ -546,7 +544,7 @@ static void ao_pause(struct audio_output *ao)
bool ret;
g_mutex_unlock(ao->mutex);
- ao_plugin_cancel(ao->plugin, ao->data);
+ ao_plugin_cancel(ao);
g_mutex_lock(ao->mutex);
ao->pause = true;
@@ -557,7 +555,7 @@ static void ao_pause(struct audio_output *ao)
break;
g_mutex_unlock(ao->mutex);
- ret = ao_plugin_pause(ao->plugin, ao->data);
+ ret = ao_plugin_pause(ao);
g_mutex_lock(ao->mutex);
if (!ret) {
@@ -631,7 +629,7 @@ static gpointer audio_output_task(gpointer arg)
assert(music_pipe_peek(ao->pipe) == NULL);
g_mutex_unlock(ao->mutex);
- ao_plugin_drain(ao->plugin, ao->data);
+ ao_plugin_drain(ao);
g_mutex_lock(ao->mutex);
}
@@ -643,7 +641,7 @@ static gpointer audio_output_task(gpointer arg)
if (ao->open) {
g_mutex_unlock(ao->mutex);
- ao_plugin_cancel(ao->plugin, ao->data);
+ ao_plugin_cancel(ao);
g_mutex_lock(ao->mutex);
}