screencast: enqueue pipewire when screencopy failed

Keeping a buffer when the copy failed has the risk of having this buffer
removed while we wait for the next buffer_done event. To prevent this we
just enqueue the buffer marking it as corrupt. A new buffer will be
dequeued at the buffer_done event.
This commit is contained in:
columbarius 2022-04-24 11:59:44 +02:00
parent 2f32d17448
commit 5799adeb57

View file

@ -50,6 +50,10 @@ void xdpw_wlr_frame_finish(struct xdpw_screencast_instance *cast) {
pwr_update_stream_param(cast); pwr_update_stream_param(cast);
} }
if (cast->frame_state == XDPW_FRAME_STATE_FAILED) {
xdpw_pwr_enqueue_buffer(cast);
}
if (cast->frame_state == XDPW_FRAME_STATE_SUCCESS) { if (cast->frame_state == XDPW_FRAME_STATE_SUCCESS) {
xdpw_pwr_enqueue_buffer(cast); xdpw_pwr_enqueue_buffer(cast);
uint64_t delay_ns = fps_limit_measure_end(&cast->fps_limit, cast->framerate); uint64_t delay_ns = fps_limit_measure_end(&cast->fps_limit, cast->framerate);