mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: libcamera: source: freeBuffers(): call when format is unset
At the moment the libcamera buffer allocation is completely tied to format
negotiation. `freeBuffers()` undoes `allocBuffers()`. And `allocBuffers()`
is called as part of `spa_libcamera_set_format()`. Therefore `freeBuffers()`
should be called independent of the state of the buffers on any port.
Otherwise unsetting the format while there are no buffers on the port will
cause the libcamera requests and buffers not to be released correctly. Similarly,
removing the buffers from a port would clear the libcamera requests and buffers,
making the node unusable without setting a new format.
(cherry picked from commit b9b7c0ab05)
This commit is contained in:
parent
a5cb888578
commit
b28eb20c1f
1 changed files with 1 additions and 1 deletions
|
|
@ -353,7 +353,6 @@ int spa_libcamera_clear_buffers(struct impl *impl, struct port *port)
|
|||
}
|
||||
|
||||
impl->pendingRequests.clear();
|
||||
freeBuffers(impl, port);
|
||||
port->n_buffers = 0;
|
||||
port->ring = SPA_RINGBUFFER_INIT();
|
||||
|
||||
|
|
@ -1818,6 +1817,7 @@ int port_set_format(struct impl *impl, struct port *port,
|
|||
|
||||
spa_libcamera_stream_off(impl);
|
||||
spa_libcamera_clear_buffers(impl, port);
|
||||
freeBuffers(impl, port);
|
||||
port->current_format.reset();
|
||||
|
||||
spa_libcamera_close(impl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue