mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: always use rate_match value when available
The minreq is just a fallback for when we don't know the exact amount of required samples to consume from the ringbuffer.
This commit is contained in:
		
							parent
							
								
									02295c5e2b
								
							
						
					
					
						commit
						bf25fc1388
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -1444,9 +1444,10 @@ static void stream_process(void *data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (stream->direction == PW_DIRECTION_OUTPUT) {
 | 
						if (stream->direction == PW_DIRECTION_OUTPUT) {
 | 
				
			||||||
		int32_t avail = spa_ringbuffer_get_read_index(&stream->ring, &pd.read_index);
 | 
							int32_t avail = spa_ringbuffer_get_read_index(&stream->ring, &pd.read_index);
 | 
				
			||||||
		minreq = SPA_MAX(stream->minblock, stream->attr.minreq);
 | 
					 | 
				
			||||||
		if (stream->rate_match)
 | 
							if (stream->rate_match)
 | 
				
			||||||
			minreq = SPA_MIN(minreq, stream->rate_match->size * stream->frame_size);
 | 
								minreq = stream->rate_match->size * stream->frame_size;
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								minreq = SPA_MAX(stream->minblock, stream->attr.minreq);
 | 
				
			||||||
		if (avail <= 0) {
 | 
							if (avail <= 0) {
 | 
				
			||||||
			/* underrun, produce a silence buffer */
 | 
								/* underrun, produce a silence buffer */
 | 
				
			||||||
			size = SPA_MIN(buf->datas[0].maxsize, minreq);
 | 
								size = SPA_MIN(buf->datas[0].maxsize, minreq);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue