mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse: we can pass the device name directly in NODE_TARGET now
This commit is contained in:
		
							parent
							
								
									3567efb7f8
								
							
						
					
					
						commit
						fc6a729c57
					
				
					 1 changed files with 2 additions and 20 deletions
				
			
		| 
						 | 
					@ -848,7 +848,6 @@ static int create_stream(pa_stream_direction_t direction,
 | 
				
			||||||
	struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
 | 
						struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
 | 
				
			||||||
	const char *str;
 | 
						const char *str;
 | 
				
			||||||
	uint32_t devid, n_items;
 | 
						uint32_t devid, n_items;
 | 
				
			||||||
	struct global *g;
 | 
					 | 
				
			||||||
	struct spa_dict_item items[7];
 | 
						struct spa_dict_item items[7];
 | 
				
			||||||
	bool monitor, no_remix;
 | 
						bool monitor, no_remix;
 | 
				
			||||||
	const char *name;
 | 
						const char *name;
 | 
				
			||||||
| 
						 | 
					@ -956,25 +955,8 @@ static int create_stream(pa_stream_direction_t direction,
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		devid = PW_ID_ANY;
 | 
							devid = PW_ID_ANY;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (dev == NULL) {
 | 
						if (dev == NULL)
 | 
				
			||||||
		if ((str = getenv("PIPEWIRE_NODE")) != NULL)
 | 
							dev = getenv("PIPEWIRE_NODE");
 | 
				
			||||||
			devid = atoi(str);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else if (devid == PW_ID_ANY) {
 | 
					 | 
				
			||||||
		uint32_t mask;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (direction == PA_STREAM_PLAYBACK)
 | 
					 | 
				
			||||||
			mask = PA_SUBSCRIPTION_MASK_SINK;
 | 
					 | 
				
			||||||
		else if (direction == PA_STREAM_RECORD)
 | 
					 | 
				
			||||||
			mask = PA_SUBSCRIPTION_MASK_SOURCE;
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			mask = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if ((g = pa_context_find_global_by_name(s->context, mask, dev)) != NULL)
 | 
					 | 
				
			||||||
			devid = g->id;
 | 
					 | 
				
			||||||
		else if ((devid = atoi(dev)) == 0)
 | 
					 | 
				
			||||||
			devid = PW_ID_ANY;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) != NULL) {
 | 
						if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) != NULL) {
 | 
				
			||||||
		if (strcmp(str, "video") == 0)
 | 
							if (strcmp(str, "video") == 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue