mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	a2dpsink: only request new data when buffer is done
This commit is contained in:
		
							parent
							
								
									715be5dfe7
								
							
						
					
					
						commit
						1f1386879b
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -563,7 +563,10 @@ static int flush_data(struct impl *this, uint64_t now_time)
 | 
				
			||||||
		if (written > 0 && l1 > 0)
 | 
							if (written > 0 && l1 > 0)
 | 
				
			||||||
			written += add_data(this, src, l1);
 | 
								written += add_data(this, src, l1);
 | 
				
			||||||
		if (written <= 0) {
 | 
							if (written <= 0) {
 | 
				
			||||||
 | 
							        /* only request new data when the current buffer will be fully processed in the next iteration */
 | 
				
			||||||
 | 
								if (port->ready_offset + (this->frame_count * this->codesize) >= d[0].chunk->size)
 | 
				
			||||||
			        port->need_data = true;
 | 
								        port->need_data = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (written < 0 && written != -ENOSPC) {
 | 
								if (written < 0 && written != -ENOSPC) {
 | 
				
			||||||
				spa_list_remove(&b->link);
 | 
									spa_list_remove(&b->link);
 | 
				
			||||||
				b->outstanding = true;
 | 
									b->outstanding = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue