mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	alsa: never queue buffers when rate matching
When we are following the resampler requested size in capture, never keep queued buffers around or we might get out of sync with the requested size and cause cracks and pops in the resampler. See #805
This commit is contained in:
		
							parent
							
								
									34800dc019
								
							
						
					
					
						commit
						8c334fa3ab
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -1147,6 +1147,9 @@ push_frames(struct state *state,
 | 
				
			||||||
				snd_pcm_readi(state->hndl, bufs[0], total_frames);
 | 
									snd_pcm_readi(state->hndl, bufs[0], total_frames);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							spa_log_trace_fp(state->log, NAME" %p: wrote %ld frames into buffer %d",
 | 
				
			||||||
 | 
									state, total_frames, b->id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spa_list_append(&state->ready, &b->link);
 | 
							spa_list_append(&state->ready, &b->link);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return total_frames;
 | 
						return total_frames;
 | 
				
			||||||
| 
						 | 
					@ -1307,7 +1310,8 @@ static int handle_capture(struct state *state, uint64_t nsec,
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	io = state->io;
 | 
						io = state->io;
 | 
				
			||||||
	if (io != NULL && io->status != SPA_STATUS_HAVE_DATA) {
 | 
						if (io != NULL &&
 | 
				
			||||||
 | 
						    (io->status != SPA_STATUS_HAVE_DATA || state->rate_match != NULL)) {
 | 
				
			||||||
		struct buffer *b;
 | 
							struct buffer *b;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (io->buffer_id < state->n_buffers)
 | 
							if (io->buffer_id < state->n_buffers)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue