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:
parent
601fb2f93a
commit
7230d88c7e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user