mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: don't send invalid format and channels
This commit is contained in:
		
							parent
							
								
									0c66b5677b
								
							
						
					
					
						commit
						2cd59fdf8b
					
				
					 2 changed files with 27 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -3410,6 +3410,11 @@ static int fill_sink_info(struct client *client, struct message *m,
 | 
			
		|||
 | 
			
		||||
	collect_device_info(o, card, &dev_info);
 | 
			
		||||
 | 
			
		||||
	if (!sample_spec_valid(&dev_info.ss) ||
 | 
			
		||||
	    !channel_map_valid(&dev_info.map) ||
 | 
			
		||||
	    !volume_valid(&dev_info.volume_info.volume))
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
 | 
			
		||||
	flags = SINK_LATENCY | SINK_DYNAMIC_LATENCY | SINK_DECIBEL_VOLUME;
 | 
			
		||||
	if ((str = spa_dict_lookup(info->props, PW_KEY_DEVICE_API)) != NULL)
 | 
			
		||||
                flags |= SINK_HARDWARE;
 | 
			
		||||
| 
						 | 
				
			
			@ -3539,6 +3544,11 @@ static int fill_source_info(struct client *client, struct message *m,
 | 
			
		|||
 | 
			
		||||
	collect_device_info(o, card, &dev_info);
 | 
			
		||||
 | 
			
		||||
	if (!sample_spec_valid(&dev_info.ss) ||
 | 
			
		||||
	    !channel_map_valid(&dev_info.map) ||
 | 
			
		||||
	    !volume_valid(&dev_info.volume_info.volume))
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
 | 
			
		||||
	flags = SOURCE_LATENCY | SOURCE_DYNAMIC_LATENCY | SOURCE_DECIBEL_VOLUME;
 | 
			
		||||
	if ((str = spa_dict_lookup(info->props, PW_KEY_DEVICE_API)) != NULL)
 | 
			
		||||
                flags |= SOURCE_HARDWARE;
 | 
			
		||||
| 
						 | 
				
			
			@ -3642,6 +3652,11 @@ static int fill_sink_input_info(struct client *client, struct message *m,
 | 
			
		|||
 | 
			
		||||
	collect_device_info(o, NULL, &dev_info);
 | 
			
		||||
 | 
			
		||||
	if (!sample_spec_valid(&dev_info.ss) ||
 | 
			
		||||
	    !channel_map_valid(&dev_info.map) ||
 | 
			
		||||
	    !volume_valid(&dev_info.volume_info.volume))
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
 | 
			
		||||
	peer = find_linked(manager, o->id, PW_DIRECTION_OUTPUT);
 | 
			
		||||
 | 
			
		||||
	message_put(m,
 | 
			
		||||
| 
						 | 
				
			
			@ -3707,6 +3722,11 @@ static int fill_source_output_info(struct client *client, struct message *m,
 | 
			
		|||
 | 
			
		||||
	collect_device_info(o, NULL, &dev_info);
 | 
			
		||||
 | 
			
		||||
	if (!sample_spec_valid(&dev_info.ss) ||
 | 
			
		||||
	    !channel_map_valid(&dev_info.map) ||
 | 
			
		||||
	    !volume_valid(&dev_info.volume_info.volume))
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
 | 
			
		||||
	peer = find_linked(manager, o->id, PW_DIRECTION_INPUT);
 | 
			
		||||
	if (peer && is_source_or_monitor(peer)) {
 | 
			
		||||
		peer_id = peer->id;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue