mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	metadata: return pw_metadata from factory create
That is what the factory return value says.
This commit is contained in:
		
							parent
							
								
									c968259348
								
							
						
					
					
						commit
						6394eb1b18
					
				
					 2 changed files with 10 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -29,7 +29,7 @@ static const struct spa_dict_item module_props[] = {
 | 
			
		|||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void * pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
 | 
			
		||||
struct pw_metadata *pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
 | 
			
		||||
		   struct pw_properties *properties);
 | 
			
		||||
 | 
			
		||||
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ static void *create_object(void *_data,
 | 
			
		|||
{
 | 
			
		||||
	struct factory_data *data = _data;
 | 
			
		||||
	struct pw_context *context = pw_impl_module_get_context(data->module);
 | 
			
		||||
	void *result;
 | 
			
		||||
	struct pw_metadata *result;
 | 
			
		||||
	struct pw_resource *metadata_resource = NULL;
 | 
			
		||||
	struct pw_impl_client *client = resource ? pw_resource_get_client(resource) : NULL;
 | 
			
		||||
	int res;
 | 
			
		||||
| 
						 | 
				
			
			@ -91,13 +91,16 @@ static void *create_object(void *_data,
 | 
			
		|||
			goto error_node;
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		result = pw_context_create_metadata(context, NULL, properties, 0);
 | 
			
		||||
		if (result == NULL) {
 | 
			
		||||
		struct pw_impl_metadata *impl;
 | 
			
		||||
 | 
			
		||||
		impl = pw_context_create_metadata(context, NULL, properties, 0);
 | 
			
		||||
		if (impl == NULL) {
 | 
			
		||||
			properties = NULL;
 | 
			
		||||
			res = -errno;
 | 
			
		||||
			goto error_node;
 | 
			
		||||
		}
 | 
			
		||||
		pw_impl_metadata_register(result, NULL);
 | 
			
		||||
		pw_impl_metadata_register(impl, NULL);
 | 
			
		||||
		result = pw_impl_metadata_get_implementation(impl);
 | 
			
		||||
	}
 | 
			
		||||
	return result;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue