mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Remove some useless checks
This commit is contained in:
		
							parent
							
								
									8123e271ec
								
							
						
					
					
						commit
						d31c057b42
					
				
					 6 changed files with 7 additions and 19 deletions
				
			
		| 
						 | 
					@ -1043,9 +1043,7 @@ static struct sm_object *init_object(struct impl *impl, const struct object_info
 | 
				
			||||||
			pw_proxy_add_object_listener(obj->proxy, &obj->object_listener, info->events, obj);
 | 
								pw_proxy_add_object_listener(obj->proxy, &obj->object_listener, info->events, obj);
 | 
				
			||||||
		SPA_FLAG_UPDATE(obj->mask, SM_OBJECT_CHANGE_MASK_LISTENER, info->events != NULL);
 | 
							SPA_FLAG_UPDATE(obj->mask, SM_OBJECT_CHANGE_MASK_LISTENER, info->events != NULL);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (handle) {
 | 
					 | 
				
			||||||
	pw_proxy_add_listener(obj->handle, &obj->handle_listener, &proxy_events, obj);
 | 
						pw_proxy_add_listener(obj->handle, &obj->handle_listener, &proxy_events, obj);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (info->init)
 | 
						if (info->init)
 | 
				
			||||||
		info->init(obj);
 | 
							info->init(obj);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -214,9 +214,6 @@ static DBusHandlerResult object_handler(DBusConnection *c, DBusMessage *m, void
 | 
				
			||||||
	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 | 
						return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
invalid:
 | 
					invalid:
 | 
				
			||||||
	if (reply)
 | 
					 | 
				
			||||||
		dbus_message_unref(reply);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!(reply = dbus_message_new_error(m,
 | 
						if (!(reply = dbus_message_new_error(m,
 | 
				
			||||||
					DBUS_ERROR_INVALID_ARGS,
 | 
										DBUS_ERROR_INVALID_ARGS,
 | 
				
			||||||
					"Invalid arguments")))
 | 
										"Invalid arguments")))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -633,10 +633,7 @@ static int impl_port_set_param(void *object,
 | 
				
			||||||
	if (filter->state == PW_FILTER_STATE_ERROR)
 | 
						if (filter->state == PW_FILTER_STATE_ERROR)
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (port)
 | 
					 | 
				
			||||||
	emit_port_info(impl, port, false);
 | 
						emit_port_info(impl, port, false);
 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		emit_node_info(impl, false);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return res;
 | 
						return res;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -199,7 +199,7 @@ void pw_thread_loop_destroy(struct pw_thread_loop *loop)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_loop_destroy_source(loop->loop, loop->event);
 | 
						pw_loop_destroy_source(loop->loop, loop->event);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (loop->created && loop->loop)
 | 
						if (loop->created)
 | 
				
			||||||
		pw_loop_destroy(loop->loop);
 | 
							pw_loop_destroy(loop->loop);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pthread_cond_destroy(&loop->accept_cond);
 | 
						pthread_cond_destroy(&loop->accept_cond);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1777,10 +1777,6 @@ children_of(struct remote_data *rd, uint32_t parent_id,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!count)
 | 
					 | 
				
			||||||
		return 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return count;
 | 
						return count;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -246,7 +246,7 @@ static void draw_node(struct global *g)
 | 
				
			||||||
	struct global *p;
 | 
						struct global *p;
 | 
				
			||||||
	const char *prop_node_id;
 | 
						const char *prop_node_id;
 | 
				
			||||||
	spa_list_for_each(p, &g->data->globals, link) {
 | 
						spa_list_for_each(p, &g->data->globals, link) {
 | 
				
			||||||
		if (p == NULL || p->info == NULL)
 | 
							if (p->info == NULL)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		if (p->type != INTERFACE_Port)
 | 
							if (p->type != INTERFACE_Port)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
| 
						 | 
					@ -407,7 +407,7 @@ static bool is_node_id_link_referenced(uint32_t id, struct spa_list *globals)
 | 
				
			||||||
        struct global *g;
 | 
					        struct global *g;
 | 
				
			||||||
        struct pw_link_info *info;
 | 
					        struct pw_link_info *info;
 | 
				
			||||||
        spa_list_for_each(g, globals, link) {
 | 
					        spa_list_for_each(g, globals, link) {
 | 
				
			||||||
                if (g == NULL || g->info == NULL)
 | 
					                if (g->info == NULL)
 | 
				
			||||||
                        continue;
 | 
					                        continue;
 | 
				
			||||||
                if (g->type != INTERFACE_Link)
 | 
					                if (g->type != INTERFACE_Link)
 | 
				
			||||||
                        continue;
 | 
					                        continue;
 | 
				
			||||||
| 
						 | 
					@ -424,7 +424,7 @@ static bool is_module_id_factory_referenced(uint32_t id, struct spa_list *global
 | 
				
			||||||
        struct pw_factory_info *info;
 | 
					        struct pw_factory_info *info;
 | 
				
			||||||
        const char *module_id_str;
 | 
					        const char *module_id_str;
 | 
				
			||||||
        spa_list_for_each(g, globals, link) {
 | 
					        spa_list_for_each(g, globals, link) {
 | 
				
			||||||
                if (g == NULL || g->info == NULL)
 | 
					                if (g->info == NULL)
 | 
				
			||||||
                        continue;
 | 
					                        continue;
 | 
				
			||||||
                if (g->type != INTERFACE_Factory)
 | 
					                if (g->type != INTERFACE_Factory)
 | 
				
			||||||
                        continue;
 | 
					                        continue;
 | 
				
			||||||
| 
						 | 
					@ -461,7 +461,7 @@ static int draw_graph(struct data *d, const char *path)
 | 
				
			||||||
	/* iterate the globals */
 | 
						/* iterate the globals */
 | 
				
			||||||
	spa_list_for_each(g, &d->globals, link) {
 | 
						spa_list_for_each(g, &d->globals, link) {
 | 
				
			||||||
		/* skip null and non-info globals */
 | 
							/* skip null and non-info globals */
 | 
				
			||||||
		if (g == NULL || g->info == NULL)
 | 
							if (g->info == NULL)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* always skip ports since they are drawn by the nodes */
 | 
							/* always skip ports since they are drawn by the nodes */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue