aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-11-07 15:30:18 +0100
committerMax Kellermann <max@duempel.org>2010-11-07 15:30:18 +0100
commit4478b3ef741eecf7ed0cf94179986c6f86a57287 (patch)
treeb10d931fa854e12d813ec796e16a45ae7af930e3 /src/output_control.c
parent5a263206803556a600a75dd5e1813feb510af268 (diff)
parentdec7090198a0bbdd91ab8c531b84624f8bde4da9 (diff)
downloadmpd-4478b3ef741eecf7ed0cf94179986c6f86a57287.tar.gz
mpd-4478b3ef741eecf7ed0cf94179986c6f86a57287.tar.xz
mpd-4478b3ef741eecf7ed0cf94179986c6f86a57287.zip
Merge release 0.15.14 from branch 'v0.15.x'
Conflicts: NEWS configure.ac src/decoder_control.c src/decoder_control.h src/input/rewind_input_plugin.c src/output_control.c src/output_thread.c src/player_thread.c
Diffstat (limited to 'src/output_control.c')
-rw-r--r--src/output_control.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/output_control.c b/src/output_control.c
index 5b9b2b902..161404f78 100644
--- a/src/output_control.c
+++ b/src/output_control.c
@@ -102,6 +102,12 @@ audio_output_disable(struct audio_output *ao)
g_mutex_unlock(ao->mutex);
}
+static void
+audio_output_close_locked(struct audio_output *ao);
+
+/**
+ * Object must be locked (and unlocked) by the caller.
+ */
static bool
audio_output_open(struct audio_output *ao,
const struct audio_format *audio_format,
@@ -173,6 +179,8 @@ audio_output_open(struct audio_output *ao,
static void
audio_output_close_locked(struct audio_output *ao)
{
+ assert(ao != NULL);
+
if (ao->mixer != NULL)
mixer_auto_close(ao->mixer);
@@ -251,25 +259,6 @@ void audio_output_cancel(struct audio_output *ao)
g_mutex_unlock(ao->mutex);
}
-void audio_output_close(struct audio_output *ao)
-{
- if (ao->mixer != NULL)
- mixer_auto_close(ao->mixer);
-
- g_mutex_lock(ao->mutex);
-
- assert(!ao->open || ao->fail_timer == NULL);
-
- if (ao->open)
- ao_command(ao, AO_COMMAND_CLOSE);
- else if (ao->fail_timer != NULL) {
- g_timer_destroy(ao->fail_timer);
- ao->fail_timer = NULL;
- }
-
- g_mutex_unlock(ao->mutex);
-}
-
void
audio_output_release(struct audio_output *ao)
{
@@ -279,6 +268,16 @@ audio_output_release(struct audio_output *ao)
audio_output_close(ao);
}
+void audio_output_close(struct audio_output *ao)
+{
+ assert(ao != NULL);
+ assert(!ao->open || ao->fail_timer == NULL);
+
+ g_mutex_lock(ao->mutex);
+ audio_output_close_locked(ao);
+ g_mutex_unlock(ao->mutex);
+}
+
void audio_output_finish(struct audio_output *ao)
{
audio_output_close(ao);