mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	alsa-pcm: don't force quantum for iec958 formats
This fixes an issue introduced in 771f71f622
where the quantum is forced and may break applications the specify their
own quantum.
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									d3980f7cef
								
							
						
					
					
						commit
						1b115eaf31
					
				
					 2 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1871,7 +1871,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
 | 
			
		|||
			state->have_format, state->started);
 | 
			
		||||
 | 
			
		||||
	state->use_mmap = !state->disable_mmap;
 | 
			
		||||
	state->force_position = false;
 | 
			
		||||
	state->force_rate = false;
 | 
			
		||||
 | 
			
		||||
	switch (fmt->media_subtype) {
 | 
			
		||||
	case SPA_MEDIA_SUBTYPE_raw:
 | 
			
		||||
| 
						 | 
				
			
			@ -1934,7 +1934,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
 | 
			
		|||
				IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO,
 | 
			
		||||
				IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,
 | 
			
		||||
				0, aes3);
 | 
			
		||||
		state->force_position = true;
 | 
			
		||||
		state->force_rate = true;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
	case SPA_MEDIA_SUBTYPE_dsd:
 | 
			
		||||
| 
						 | 
				
			
			@ -2718,16 +2718,20 @@ static inline int check_position_config(struct state *state)
 | 
			
		|||
	if (SPA_UNLIKELY((pos = state->position) == NULL))
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	if (state->force_position ||
 | 
			
		||||
	    (state->disable_tsched && state->started && !state->following)) {
 | 
			
		||||
	if (state->disable_tsched && state->started && !state->following) {
 | 
			
		||||
		target_duration = state->period_frames;
 | 
			
		||||
		target_rate = SPA_FRACTION(1, state->rate);
 | 
			
		||||
		pos->clock.target_duration = target_duration;
 | 
			
		||||
		pos->clock.target_rate = target_rate;
 | 
			
		||||
	} else {
 | 
			
		||||
		target_duration = pos->clock.target_duration;
 | 
			
		||||
		if (state->force_rate && !state->following) {
 | 
			
		||||
			target_rate = SPA_FRACTION(1, state->rate);
 | 
			
		||||
			pos->clock.target_rate = target_rate;
 | 
			
		||||
		} else {
 | 
			
		||||
			target_rate = pos->clock.target_rate;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if (target_duration == 0 || target_rate.denom == 0)
 | 
			
		||||
		return -EIO;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -227,7 +227,7 @@ struct state {
 | 
			
		|||
	unsigned int auto_link:1;
 | 
			
		||||
	unsigned int linked:1;
 | 
			
		||||
	unsigned int is_batch:1;
 | 
			
		||||
	unsigned int force_position:1;
 | 
			
		||||
	unsigned int force_rate:1;
 | 
			
		||||
 | 
			
		||||
	uint64_t iec958_codecs;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue