From 319ba94a527ac29d3b42543f0f9679a60bc308d6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 10 Jan 2011 21:52:38 +0100 Subject: [PATCH] output_control: ao_command() calls ao_command_async() Merge some code. --- src/output_control.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/output_control.c b/src/output_control.c index 161404f78..371730ef2 100644 --- a/src/output_control.c +++ b/src/output_control.c @@ -47,14 +47,6 @@ static void ao_command_wait(struct audio_output *ao) } } -static void ao_command(struct audio_output *ao, enum audio_output_command cmd) -{ - assert(ao->command == AO_COMMAND_NONE); - ao->command = cmd; - g_cond_signal(ao->cond); - ao_command_wait(ao); -} - static void ao_command_async(struct audio_output *ao, enum audio_output_command cmd) { @@ -63,6 +55,13 @@ static void ao_command_async(struct audio_output *ao, g_cond_signal(ao->cond); } +static void +ao_command(struct audio_output *ao, enum audio_output_command cmd) +{ + ao_command_async(ao, cmd); + ao_command_wait(ao); +} + void audio_output_enable(struct audio_output *ao) {