mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: libcamera: source: reset ring buffer when stopping
Presently, the ring buffer of completed requests is only cleared when the buffers are removed from the port. This is not entirely correct since pause/start commands do not clear the buffers but they stop the camera. As a consequence, it is possible that some completed requests stay in the ring buffer, causing them to be mistakenly processed when the camera is started next. So reset the ring buffer after the camera is stopped, the same time as the queue of free buffers is cleared.
This commit is contained in:
parent
72fd462090
commit
c01a2977a5
1 changed files with 1 additions and 1 deletions
|
|
@ -363,7 +363,6 @@ int spa_libcamera_clear_buffers(struct impl *impl, struct port *port)
|
|||
}
|
||||
|
||||
port->n_buffers = 0;
|
||||
impl->completed_requests_rb = SPA_RINGBUFFER_INIT();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1390,6 +1389,7 @@ int spa_libcamera_stream_off(struct impl *impl)
|
|||
impl->source.fd = -1;
|
||||
}
|
||||
|
||||
impl->completed_requests_rb = SPA_RINGBUFFER_INIT();
|
||||
spa_list_init(&port->queue);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue