Fix the number of outstanding operations.
This uses an incrementing rather than fixed value as it more obviously reflects what's going on.
This commit is contained in:
parent
188ee8c2c2
commit
d816be58d6
|
@ -2152,49 +2152,57 @@ void context_state_callback(pa_context *c, void *userdata) {
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
|
||||||
|
// Keep track of the outstanding callbacks for UI tweaks
|
||||||
|
n_outstanding = 0;
|
||||||
|
|
||||||
if (!(o = pa_context_get_server_info(c, server_info_cb, w))) {
|
if (!(o = pa_context_get_server_info(c, server_info_cb, w))) {
|
||||||
show_error(_("pa_context_get_server_info() failed"));
|
show_error(_("pa_context_get_server_info() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
|
|
||||||
if (!(o = pa_context_get_client_info_list(c, client_cb, w))) {
|
if (!(o = pa_context_get_client_info_list(c, client_cb, w))) {
|
||||||
show_error(_("pa_context_client_info_list() failed"));
|
show_error(_("pa_context_client_info_list() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
|
|
||||||
if (!(o = pa_context_get_card_info_list(c, card_cb, w))) {
|
if (!(o = pa_context_get_card_info_list(c, card_cb, w))) {
|
||||||
show_error(_("pa_context_get_card_info_list() failed"));
|
show_error(_("pa_context_get_card_info_list() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
|
|
||||||
if (!(o = pa_context_get_sink_info_list(c, sink_cb, w))) {
|
if (!(o = pa_context_get_sink_info_list(c, sink_cb, w))) {
|
||||||
show_error(_("pa_context_get_sink_info_list() failed"));
|
show_error(_("pa_context_get_sink_info_list() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
|
|
||||||
if (!(o = pa_context_get_source_info_list(c, source_cb, w))) {
|
if (!(o = pa_context_get_source_info_list(c, source_cb, w))) {
|
||||||
show_error(_("pa_context_get_source_info_list() failed"));
|
show_error(_("pa_context_get_source_info_list() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
|
|
||||||
if (!(o = pa_context_get_sink_input_info_list(c, sink_input_cb, w))) {
|
if (!(o = pa_context_get_sink_input_info_list(c, sink_input_cb, w))) {
|
||||||
show_error(_("pa_context_get_sink_input_info_list() failed"));
|
show_error(_("pa_context_get_sink_input_info_list() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
|
|
||||||
if (!(o = pa_context_get_source_output_info_list(c, source_output_cb, w))) {
|
if (!(o = pa_context_get_source_output_info_list(c, source_output_cb, w))) {
|
||||||
show_error(_("pa_context_get_source_output_info_list() failed"));
|
show_error(_("pa_context_get_source_output_info_list() failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pa_operation_unref(o);
|
pa_operation_unref(o);
|
||||||
|
n_outstanding++;
|
||||||
n_outstanding = 6;
|
|
||||||
|
|
||||||
/* This call is not always supported */
|
/* This call is not always supported */
|
||||||
if ((o = pa_ext_stream_restore_read(c, ext_stream_restore_read_cb, w))) {
|
if ((o = pa_ext_stream_restore_read(c, ext_stream_restore_read_cb, w))) {
|
||||||
|
|
Loading…
Reference in New Issue