mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
adapter: pass error to factory
This commit is contained in:
parent
8513150bdf
commit
cfce048528
2 changed files with 7 additions and 6 deletions
|
|
@ -188,7 +188,7 @@ static void *create_object(void *_data,
|
|||
PW_SPA_NODE_FLAG_NO_REGISTER,
|
||||
pw_properties_copy(properties), 0);
|
||||
if (follower == NULL)
|
||||
goto error_no_mem;
|
||||
goto error_errno;
|
||||
}
|
||||
|
||||
adapter = pw_adapter_new(pw_impl_module_get_context(d->module),
|
||||
|
|
@ -198,8 +198,8 @@ static void *create_object(void *_data,
|
|||
properties = NULL;
|
||||
|
||||
if (adapter == NULL) {
|
||||
if (errno == ENOMEM)
|
||||
goto error_no_mem;
|
||||
if (errno == ENOMEM || errno == EBUSY)
|
||||
goto error_errno;
|
||||
else
|
||||
goto error_usage;
|
||||
}
|
||||
|
|
@ -226,7 +226,7 @@ error_properties:
|
|||
if (resource)
|
||||
pw_resource_errorf_id(resource, new_id, res, "usage: " FACTORY_USAGE);
|
||||
goto error_cleanup;
|
||||
error_no_mem:
|
||||
error_errno:
|
||||
res = -errno;
|
||||
pw_log_error("can't create node: %m");
|
||||
if (resource)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include <spa/node/node.h>
|
||||
#include <spa/node/utils.h>
|
||||
#include <spa/utils/hook.h>
|
||||
#include <spa/utils/result.h>
|
||||
#include <spa/utils/names.h>
|
||||
#include <spa/utils/type-info.h>
|
||||
#include <spa/param/format.h>
|
||||
|
|
@ -171,8 +172,8 @@ static int find_format(struct pw_impl_node *node, enum pw_direction direction,
|
|||
SPA_DIRECTION_OUTPUT, 0,
|
||||
SPA_PARAM_EnumFormat, &state,
|
||||
NULL, &format, &b)) != 1) {
|
||||
pw_log_warn(NAME " %p: no format given", node);
|
||||
return -ENOENT;
|
||||
pw_log_warn(NAME " %p: can't get format: %s", node, spa_strerror(res));
|
||||
return res;
|
||||
}
|
||||
|
||||
if ((res = spa_format_parse(format, media_type, media_subtype)) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue