mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	stream: move from dequeued to queued for capture stream flush
When flushing a capture stream we move all dequeued buffers to the queued queue for recycling. The dequeued queue is filled again when captured buffers become available. Otherwise we might never recycle some dequeued buffers.
This commit is contained in:
		
							parent
							
								
									b1a80a8f46
								
							
						
					
					
						commit
						dd36352a5c
					
				
					 1 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -2374,12 +2374,21 @@ do_flush(struct spa_loop *loop,
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct stream *impl = user_data;
 | 
						struct stream *impl = user_data;
 | 
				
			||||||
	struct buffer *b;
 | 
						struct buffer *b;
 | 
				
			||||||
 | 
						struct queue *from, *to;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_trace_fp("%p: flush", impl);
 | 
						pw_log_trace_fp("%p: flush", impl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (impl->direction == SPA_DIRECTION_OUTPUT) {
 | 
				
			||||||
 | 
							from = &impl->queued;
 | 
				
			||||||
 | 
							to = &impl->dequeued;
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							from = &impl->dequeued;
 | 
				
			||||||
 | 
							to = &impl->queued;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		b = queue_pop(impl, &impl->queued);
 | 
							b = queue_pop(impl, from);
 | 
				
			||||||
		if (b != NULL)
 | 
							if (b != NULL)
 | 
				
			||||||
			queue_push(impl, &impl->dequeued, b);
 | 
								queue_push(impl, to, b);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	while (b);
 | 
						while (b);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue