1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00

ao_pulse: correctly wait for stream state

This works similar to condition variables; for some reason this
apparently worked fine until now, but it breaks with passthrough mode.
This commit is contained in:
wm4 2014-09-23 22:47:32 +02:00
parent 601fb2f93a
commit 7230d88c7e

View File

@ -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;