mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: libcamera: source: simplify spa_libcamera_clear_buffers()
Remove the unused `impl` parameter and the unnecessary early return.
This commit is contained in:
parent
b948ffdb25
commit
bf327d3dfb
1 changed files with 4 additions and 9 deletions
|
|
@ -371,14 +371,9 @@ err:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int spa_libcamera_clear_buffers(struct impl *impl, struct port *port)
|
int spa_libcamera_clear_buffers(struct port *port)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
for (std::size_t i = 0; i < port->n_buffers; i++) {
|
||||||
|
|
||||||
if (port->n_buffers == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
for (i = 0; i < port->n_buffers; i++) {
|
|
||||||
struct buffer *b;
|
struct buffer *b;
|
||||||
struct spa_data *d;
|
struct spa_data *d;
|
||||||
|
|
||||||
|
|
@ -1833,7 +1828,7 @@ int port_set_format(struct impl *impl, struct port *port,
|
||||||
|
|
||||||
if (!try_only) {
|
if (!try_only) {
|
||||||
spa_libcamera_stream_off(impl);
|
spa_libcamera_stream_off(impl);
|
||||||
spa_libcamera_clear_buffers(impl, port);
|
spa_libcamera_clear_buffers(port);
|
||||||
freeBuffers(impl, port);
|
freeBuffers(impl, port);
|
||||||
port->current_format.reset();
|
port->current_format.reset();
|
||||||
}
|
}
|
||||||
|
|
@ -1947,7 +1942,7 @@ int impl_node_port_use_buffers(void *object,
|
||||||
|
|
||||||
if (port->n_buffers) {
|
if (port->n_buffers) {
|
||||||
spa_libcamera_stream_off(impl);
|
spa_libcamera_stream_off(impl);
|
||||||
if ((res = spa_libcamera_clear_buffers(impl, port)) < 0)
|
if ((res = spa_libcamera_clear_buffers(port)) < 0)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if (n_buffers > 0 && !port->current_format)
|
if (n_buffers > 0 && !port->current_format)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue