mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	spa: add all channel positions to the params
Pass all the positions of all channels to the format param, even when there are more channels then positions.
This commit is contained in:
		
							parent
							
								
									11f1298f53
								
							
						
					
					
						commit
						c5533b3c32
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		|  | @ -80,8 +80,8 @@ SPA_API_AUDIO_RAW_UTILS struct spa_pod * | ||||||
| spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, | spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, | ||||||
| 			   const struct spa_audio_info_raw *info) | 			   const struct spa_audio_info_raw *info) | ||||||
| { | { | ||||||
| 	struct spa_pod_frame f; | 	struct spa_pod_frame f[2]; | ||||||
| 	spa_pod_builder_push_object(builder, &f, SPA_TYPE_OBJECT_Format, id); | 	spa_pod_builder_push_object(builder, &f[0], SPA_TYPE_OBJECT_Format, id); | ||||||
| 	spa_pod_builder_add(builder, | 	spa_pod_builder_add(builder, | ||||||
| 			SPA_FORMAT_mediaType,		SPA_POD_Id(SPA_MEDIA_TYPE_audio), | 			SPA_FORMAT_mediaType,		SPA_POD_Id(SPA_MEDIA_TYPE_audio), | ||||||
| 			SPA_FORMAT_mediaSubtype,	SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), | 			SPA_FORMAT_mediaSubtype,	SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), | ||||||
|  | @ -96,13 +96,16 @@ spa_format_audio_raw_build(struct spa_pod_builder *builder, uint32_t id, | ||||||
| 		spa_pod_builder_add(builder, | 		spa_pod_builder_add(builder, | ||||||
| 			SPA_FORMAT_AUDIO_channels,	SPA_POD_Int(info->channels), 0); | 			SPA_FORMAT_AUDIO_channels,	SPA_POD_Int(info->channels), 0); | ||||||
| 		if (!SPA_FLAG_IS_SET(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED)) { | 		if (!SPA_FLAG_IS_SET(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED)) { | ||||||
| 			spa_pod_builder_add(builder, SPA_FORMAT_AUDIO_position, | 			uint32_t i; | ||||||
| 				SPA_POD_Array(sizeof(uint32_t), SPA_TYPE_Id, | 			spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0); | ||||||
| 					SPA_MIN(info->channels, SPA_N_ELEMENTS(info->position)), | 			spa_pod_builder_push_array(builder, &f[1]); | ||||||
| 					info->position), 0); | 			for (i = 0; i < info->channels; i++) | ||||||
|  | 				spa_pod_builder_id(builder, | ||||||
|  | 						spa_format_audio_raw_get_position(info, i)); | ||||||
|  | 			spa_pod_builder_pop(builder, &f[1]); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	return (struct spa_pod*)spa_pod_builder_pop(builder, &f); | 	return (struct spa_pod*)spa_pod_builder_pop(builder, &f[0]); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans