mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pipewire: remove work queue checks
Since now `pw_context_get_work_queue()` cannot fail, the checks can be removed.
This commit is contained in:
parent
eae6517c84
commit
4d4c6f20df
16 changed files with 1 additions and 71 deletions
|
|
@ -932,11 +932,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->module = module;
|
impl->module = module;
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't create work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
||||||
pw_properties_setf(props, PW_KEY_NODE_GROUP, "echo-cancel-%u", id);
|
pw_properties_setf(props, PW_KEY_NODE_GROUP, "echo-cancel-%u", id);
|
||||||
|
|
|
||||||
|
|
@ -399,11 +399,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->module = module;
|
impl->module = module;
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
||||||
pw_properties_set(props, PW_KEY_NODE_GROUP, "pipewire.dummy");
|
pw_properties_set(props, PW_KEY_NODE_GROUP, "pipewire.dummy");
|
||||||
|
|
|
||||||
|
|
@ -419,11 +419,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->module = module;
|
impl->module = module;
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
||||||
pw_properties_set(props, PW_KEY_NODE_GROUP, "pipewire.dummy");
|
pw_properties_set(props, PW_KEY_NODE_GROUP, "pipewire.dummy");
|
||||||
|
|
|
||||||
|
|
@ -1689,11 +1689,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->module = module;
|
impl->module = module;
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't create work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
impl->rate = 48000;
|
impl->rate = 48000;
|
||||||
impl->graph.impl = impl;
|
impl->graph.impl = impl;
|
||||||
spa_list_init(&impl->plugin_list);
|
spa_list_init(&impl->plugin_list);
|
||||||
|
|
|
||||||
|
|
@ -530,12 +530,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
data->module = module;
|
data->module = module;
|
||||||
data->context = context;
|
data->context = context;
|
||||||
data->work = pw_context_get_work_queue(context);
|
data->work = pw_context_get_work_queue(context);
|
||||||
if (data->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
pw_impl_factory_destroy(factory);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
spa_list_init(&data->link_list);
|
spa_list_init(&data->link_list);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -448,11 +448,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->module = module;
|
impl->module = module;
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
||||||
pw_properties_setf(props, PW_KEY_NODE_GROUP, "loopback-%u", id);
|
pw_properties_setf(props, PW_KEY_NODE_GROUP, "loopback-%u", id);
|
||||||
|
|
|
||||||
|
|
@ -5330,8 +5330,6 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context,
|
||||||
impl->props = props;
|
impl->props = props;
|
||||||
|
|
||||||
impl->work_queue = pw_context_get_work_queue(context);
|
impl->work_queue = pw_context_get_work_queue(context);
|
||||||
if (impl->work_queue == NULL)
|
|
||||||
goto error_free;
|
|
||||||
|
|
||||||
spa_list_init(&impl->servers);
|
spa_list_init(&impl->servers);
|
||||||
impl->rate_limit.interval = 2 * SPA_NSEC_PER_SEC;
|
impl->rate_limit.interval = 2 * SPA_NSEC_PER_SEC;
|
||||||
|
|
|
||||||
|
|
@ -848,10 +848,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
|
pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));
|
||||||
|
|
||||||
impl->work_queue = pw_context_get_work_queue(context);
|
impl->work_queue = pw_context_get_work_queue(context);
|
||||||
if (impl->work_queue == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
goto error_free;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((res = parse_params(impl)) < 0)
|
if ((res = parse_params(impl)) < 0)
|
||||||
goto error_free;
|
goto error_free;
|
||||||
|
|
|
||||||
|
|
@ -780,11 +780,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->module = module;
|
impl->module = module;
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
spa_ringbuffer_init(&impl->ring);
|
spa_ringbuffer_init(&impl->ring);
|
||||||
impl->buffer = calloc(1, RINGBUFFER_SIZE);
|
impl->buffer = calloc(1, RINGBUFFER_SIZE);
|
||||||
|
|
|
||||||
|
|
@ -522,8 +522,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->properties = props;
|
impl->properties = props;
|
||||||
|
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL)
|
|
||||||
goto error_errno;
|
|
||||||
|
|
||||||
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
|
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1588,11 +1588,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->context = context;
|
impl->context = context;
|
||||||
impl->loop = pw_context_get_main_loop(context);
|
impl->loop = pw_context_get_main_loop(context);
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
|
||||||
pw_properties_set(props, PW_KEY_NODE_GROUP, "pipewire.dummy");
|
pw_properties_set(props, PW_KEY_NODE_GROUP, "pipewire.dummy");
|
||||||
|
|
|
||||||
|
|
@ -417,11 +417,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
data->module = module;
|
data->module = module;
|
||||||
data->module_context = context;
|
data->module_context = context;
|
||||||
data->work = pw_context_get_work_queue(context);
|
data->work = pw_context_get_work_queue(context);
|
||||||
if (data->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((str = pw_properties_get(props, "sink.name")) != NULL) {
|
if ((str = pw_properties_get(props, "sink.name")) != NULL) {
|
||||||
pw_properties_set(capture_props, PW_KEY_NODE_NAME, str);
|
pw_properties_set(capture_props, PW_KEY_NODE_NAME, str);
|
||||||
|
|
|
||||||
|
|
@ -462,11 +462,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
data->module = module;
|
data->module = module;
|
||||||
data->module_context = context;
|
data->module_context = context;
|
||||||
data->work = pw_context_get_work_queue(context);
|
data->work = pw_context_get_work_queue(context);
|
||||||
if (data->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
pw_log_error( "can't get work queue: %m");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((str = pw_properties_get(props, "source.name")) != NULL) {
|
if ((str = pw_properties_get(props, "source.name")) != NULL) {
|
||||||
pw_properties_set(playback_props, PW_KEY_NODE_NAME, str);
|
pw_properties_set(playback_props, PW_KEY_NODE_NAME, str);
|
||||||
|
|
|
||||||
|
|
@ -540,8 +540,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
impl->properties = props;
|
impl->properties = props;
|
||||||
|
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL)
|
|
||||||
goto error_errno;
|
|
||||||
|
|
||||||
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
|
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1209,8 +1209,6 @@ struct pw_impl_link *pw_context_create_link(struct pw_context *context,
|
||||||
this->user_data = SPA_PTROFF(impl, sizeof(struct impl), void);
|
this->user_data = SPA_PTROFF(impl, sizeof(struct impl), void);
|
||||||
|
|
||||||
impl->work = pw_context_get_work_queue(context);
|
impl->work = pw_context_get_work_queue(context);
|
||||||
if (impl->work == NULL)
|
|
||||||
goto error_work_queue;
|
|
||||||
|
|
||||||
this->context = context;
|
this->context = context;
|
||||||
this->properties = properties;
|
this->properties = properties;
|
||||||
|
|
@ -1309,10 +1307,6 @@ error_no_mem:
|
||||||
res = -errno;
|
res = -errno;
|
||||||
pw_log_debug("alloc failed: %m");
|
pw_log_debug("alloc failed: %m");
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
error_work_queue:
|
|
||||||
res = -errno;
|
|
||||||
pw_log_debug("work queue failed: %m");
|
|
||||||
goto error_free;
|
|
||||||
error_output_mix:
|
error_output_mix:
|
||||||
pw_log_error("%p: can't get output mix %d (%s)", this, res, spa_strerror(res));
|
pw_log_error("%p: can't get output mix %d (%s)", this, res, spa_strerror(res));
|
||||||
goto error_free;
|
goto error_free;
|
||||||
|
|
|
||||||
|
|
@ -1236,10 +1236,6 @@ struct pw_impl_node *pw_context_create_node(struct pw_context *context,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl->work = pw_context_get_work_queue(this->context);
|
impl->work = pw_context_get_work_queue(this->context);
|
||||||
if (impl->work == NULL) {
|
|
||||||
res = -errno;
|
|
||||||
goto error_clean;
|
|
||||||
}
|
|
||||||
impl->pending_id = SPA_ID_INVALID;
|
impl->pending_id = SPA_ID_INVALID;
|
||||||
|
|
||||||
this->data_loop = context->data_loop;
|
this->data_loop = context->data_loop;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue