mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Revert "media-session: when resolving duplicate objects, bind a proxy if missing"
This reverts commit 77e4fdb1e4.
			
			
This commit is contained in:
		
							parent
							
								
									4930157875
								
							
						
					
					
						commit
						a85be79135
					
				
					 1 changed files with 2 additions and 31 deletions
				
			
		| 
						 | 
					@ -188,7 +188,7 @@ struct object_info {
 | 
				
			||||||
	void (*destroy) (void *object);
 | 
						void (*destroy) (void *object);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void resolve_duplicate_object(struct impl *impl, struct sm_object *new, struct sm_object *old);
 | 
					static void remove_object_and_destroy_if_owned(struct impl *impl, struct sm_object *obj);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void add_object(struct impl *impl, struct sm_object *obj, uint32_t id)
 | 
					static void add_object(struct impl *impl, struct sm_object *obj, uint32_t id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -216,7 +216,7 @@ static void add_object(struct impl *impl, struct sm_object *obj, uint32_t id)
 | 
				
			||||||
		spa_assert(!obj->owned_by_registry);
 | 
							spa_assert(!obj->owned_by_registry);
 | 
				
			||||||
		spa_assert(old_obj->owned_by_registry);
 | 
							spa_assert(old_obj->owned_by_registry);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		resolve_duplicate_object(impl, obj, old_obj);
 | 
							remove_object_and_destroy_if_owned(impl, old_obj);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (obj->id > size)
 | 
						while (obj->id > size)
 | 
				
			||||||
| 
						 | 
					@ -1275,35 +1275,6 @@ update_object(struct impl *impl, const struct object_info *info,
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
resolve_duplicate_object(struct impl *impl, struct sm_object *obj, struct sm_object *old)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	const struct object_info *info;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	remove_object_and_destroy_if_owned(impl, old);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (obj->proxy != NULL)
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	info = get_object_info(impl, obj->type);
 | 
					 | 
				
			||||||
	if (info == NULL)
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Obtain proxy for the new object */
 | 
					 | 
				
			||||||
	obj->proxy = pw_registry_bind(impl->registry,
 | 
					 | 
				
			||||||
			obj->id, info->type, info->version, 0);
 | 
					 | 
				
			||||||
	if (obj->proxy == NULL)
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	obj->type = info->type;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	pw_proxy_add_listener(obj->proxy, &obj->proxy_listener, &proxy_events, obj);
 | 
					 | 
				
			||||||
	if (info->events)
 | 
					 | 
				
			||||||
		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);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
registry_global(void *data, uint32_t id,
 | 
					registry_global(void *data, uint32_t id,
 | 
				
			||||||
		uint32_t permissions, const char *type, uint32_t version,
 | 
							uint32_t permissions, const char *type, uint32_t version,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue