mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	module-rtp-sap: refactor channelmap generation
This commit is contained in:
		
							parent
							
								
									aca4d93b31
								
							
						
					
					
						commit
						a7410fe1bf
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
					@ -740,6 +740,9 @@ static struct session *session_new_announce(struct impl *impl, struct node *node
 | 
				
			||||||
	if ((str = pw_properties_get(props, "rtp.ts-refclk")) != NULL)
 | 
						if ((str = pw_properties_get(props, "rtp.ts-refclk")) != NULL)
 | 
				
			||||||
		sdp->ts_refclk = strdup(str);
 | 
							sdp->ts_refclk = strdup(str);
 | 
				
			||||||
	if ((str = pw_properties_get(props, PW_KEY_NODE_CHANNELNAMES)) != NULL) {
 | 
						if ((str = pw_properties_get(props, PW_KEY_NODE_CHANNELNAMES)) != NULL) {
 | 
				
			||||||
 | 
							struct spa_strbuf buf;
 | 
				
			||||||
 | 
							spa_strbuf_init(&buf, sdp->channelmap, sizeof(sdp->channelmap));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		struct spa_json it[2];
 | 
							struct spa_json it[2];
 | 
				
			||||||
		char v[256];
 | 
							char v[256];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -748,10 +751,9 @@ static struct session *session_new_announce(struct impl *impl, struct node *node
 | 
				
			||||||
			spa_json_init(&it[1], str, strlen(str));
 | 
								spa_json_init(&it[1], str, strlen(str));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (spa_json_get_string(&it[1], v, sizeof(v)) > 0)
 | 
							if (spa_json_get_string(&it[1], v, sizeof(v)) > 0)
 | 
				
			||||||
			snprintf(sdp->channelmap, sizeof(sdp->channelmap) - 1, "%s", v);
 | 
								spa_strbuf_append(&buf, "%s", v);
 | 
				
			||||||
		while (spa_json_get_string(&it[1], v, sizeof(v)) > 0)
 | 
							while (spa_json_get_string(&it[1], v, sizeof(v)) > 0)
 | 
				
			||||||
			snprintf(sdp->channelmap + strlen(sdp->channelmap),
 | 
								spa_strbuf_append(&buf, ", %s", v);
 | 
				
			||||||
				sizeof(sdp->channelmap) - strlen(sdp->channelmap) - 1, ", %s", v);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_info("created new session for node:%u", node->id);
 | 
						pw_log_info("created new session for node:%u", node->id);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue