mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	media-session: count property changes correctly
This commit is contained in:
		
							parent
							
								
									95718792c4
								
							
						
					
					
						commit
						f8e501169b
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
					@ -225,19 +225,21 @@ static int metadata_property(void *object, uint32_t subject,
 | 
				
			||||||
		const char *key, const char *type, const char *value)
 | 
							const char *key, const char *type, const char *value)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct impl *impl = object;
 | 
						struct impl *impl = object;
 | 
				
			||||||
	bool changed = false;
 | 
						int changed = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (impl->sync)
 | 
						if (impl->sync)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (subject == PW_ID_CORE) {
 | 
						if (subject == PW_ID_CORE) {
 | 
				
			||||||
		if (key == NULL)
 | 
							if (key == NULL) {
 | 
				
			||||||
			pw_properties_clear(impl->props);
 | 
								pw_properties_clear(impl->props);
 | 
				
			||||||
 | 
								changed = 1;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		else if (strstr(key, PREFIX) == key) {
 | 
							else if (strstr(key, PREFIX) == key) {
 | 
				
			||||||
			changed = pw_properties_set(impl->props, key, value);
 | 
								changed += pw_properties_set(impl->props, key, value);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (changed)
 | 
						if (changed > 0)
 | 
				
			||||||
		add_idle_timeout(impl);
 | 
							add_idle_timeout(impl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue