mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: libcamera: source: freeBuffers(): split pending request removal
`freeBuffers()` should undo exactly what `allocBuffers()` does. However, it currently also clears `impl::pendingRequests`, but that is filled by `spa_libcamera_buffer_recycle()` during `spa_libcamera_alloc_buffers()`. So remove the clearing of `impl::pendingRequests` from `freeBuffers()` and move it directly into `spa_libcamera_clear_buffers()`.
This commit is contained in:
		
							parent
							
								
									14e0a8f66f
								
							
						
					
					
						commit
						89545946fd
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -323,7 +323,6 @@ int allocBuffers(struct impl *impl, struct port *port, unsigned int count)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void freeBuffers(struct impl *impl, struct port *port)
 | 
					void freeBuffers(struct impl *impl, struct port *port)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	impl->pendingRequests.clear();
 | 
					 | 
				
			||||||
	impl->requestPool.clear();
 | 
						impl->requestPool.clear();
 | 
				
			||||||
	impl->allocator->free(port->streamConfig.stream());
 | 
						impl->allocator->free(port->streamConfig.stream());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -354,6 +353,7 @@ int spa_libcamera_clear_buffers(struct impl *impl, struct port *port)
 | 
				
			||||||
		d[0].type = SPA_ID_INVALID;
 | 
							d[0].type = SPA_ID_INVALID;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						impl->pendingRequests.clear();
 | 
				
			||||||
	freeBuffers(impl, port);
 | 
						freeBuffers(impl, port);
 | 
				
			||||||
	port->n_buffers = 0;
 | 
						port->n_buffers = 0;
 | 
				
			||||||
	port->ring = SPA_RINGBUFFER_INIT();
 | 
						port->ring = SPA_RINGBUFFER_INIT();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue