summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_pulse.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_pulse.c')
-rw-r--r--audio/out/ao_pulse.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c
index 1591ba6e3f..8648bd5019 100644
--- a/audio/out/ao_pulse.c
+++ b/audio/out/ao_pulse.c
@@ -380,7 +380,14 @@ static int init(struct ao *ao)
goto unlock_and_fail;
/* Wait until the stream is ready */
- pa_threaded_mainloop_wait(priv->mainloop);
+ while (1) {
+ int state = pa_stream_get_state(priv->stream);
+ if (state == PA_STREAM_READY)
+ break;
+ if (!PA_STREAM_IS_GOOD(state))
+ goto unlock_and_fail;
+ pa_threaded_mainloop_wait(priv->mainloop);
+ }
if (pa_stream_get_state(priv->stream) != PA_STREAM_READY)
goto unlock_and_fail;