Commit 7dd172ef authored by Max Kellermann's avatar Max Kellermann

mixer/pulse: don't get volume if stream is not yet ready

Moved the check from pulse_mixer_open() to pulse_mixer_update().
parent 80ac82c8
...@@ -98,7 +98,8 @@ pulse_mixer_update(struct pulse_mixer *pm) ...@@ -98,7 +98,8 @@ pulse_mixer_update(struct pulse_mixer *pm)
assert(pm->output->stream != NULL); assert(pm->output->stream != NULL);
if (pm->output->context == NULL) if (pm->output->context == NULL ||
pa_stream_get_state(pm->output->stream) != PA_STREAM_READY)
return; return;
o = pa_context_get_sink_input_info(pm->output->context, o = pa_context_get_sink_input_info(pm->output->context,
...@@ -243,8 +244,7 @@ pulse_mixer_open(struct mixer *data, G_GNUC_UNUSED GError **error_r) ...@@ -243,8 +244,7 @@ pulse_mixer_open(struct mixer *data, G_GNUC_UNUSED GError **error_r)
struct pulse_mixer *pm = (struct pulse_mixer *) data; struct pulse_mixer *pm = (struct pulse_mixer *) data;
pa_threaded_mainloop_lock(pm->output->mainloop); pa_threaded_mainloop_lock(pm->output->mainloop);
if (pm->output->stream != NULL && if (pm->output->stream != NULL)
pa_stream_get_state(pm->output->stream) == PA_STREAM_READY)
pulse_mixer_update(pm); pulse_mixer_update(pm);
pa_threaded_mainloop_unlock(pm->output->mainloop); pa_threaded_mainloop_unlock(pm->output->mainloop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment