From 4509bd8cfd5f1e04ffc67276d45bf90b4e6ec411 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 30 Jan 2019 10:36:00 +0100 Subject: [PATCH] media-session: report error when binding --- src/examples/media-session.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/examples/media-session.c b/src/examples/media-session.c index 17e93258a..8cd38500a 100644 --- a/src/examples/media-session.c +++ b/src/examples/media-session.c @@ -778,26 +778,32 @@ registry_global(void *data,uint32_t id, uint32_t parent_id, const struct spa_dict *props) { struct impl *impl = data; + int res; - pw_log_debug(NAME " %p: new global '%d'", impl, id); + pw_log_debug(NAME " %p: new global '%d' %d", impl, id, type); switch (type) { case PW_TYPE_INTERFACE_Client: - handle_client(impl, id, parent_id, type, props); + res = handle_client(impl, id, parent_id, type, props); break; case PW_TYPE_INTERFACE_Node: - handle_node(impl, id, parent_id, type, props); + res = handle_node(impl, id, parent_id, type, props); break; case PW_TYPE_INTERFACE_Port: - handle_port(impl, id, parent_id, type, props); + res = handle_port(impl, id, parent_id, type, props); break; default: + res = 0; break; } - schedule_rescan(impl); + if (res < 0) { + pw_log_warn(NAME" %p: can't handle global %d", impl, id); + } + else + schedule_rescan(impl); } static void