Fix freeze on skipped frame

When a frame is skipped, we weren't destroying the wlr frame. Since
this function kicks off the next frame capture, the stream was getting
stuck.

Closes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/81
This commit is contained in:
Simon Ser 2021-02-11 10:39:27 +01:00
parent 5b646c0482
commit 9f72a6d874

View file

@ -38,14 +38,14 @@ static void pwr_on_event(void *data, uint64_t expirations) {
if ((pw_buf = pw_stream_dequeue_buffer(cast->stream)) == NULL) {
logprint(WARN, "pipewire: out of buffers");
return;
goto out;
}
spa_buf = pw_buf->buffer;
d = spa_buf->datas;
if ((d[0].data) == NULL) {
logprint(TRACE, "pipewire: data pointer undefined");
return;
goto out;
}
if ((h = spa_buffer_find_meta_data(spa_buf, SPA_META_Header, sizeof(*h)))) {
h->pts = -1;
@ -76,6 +76,7 @@ static void pwr_on_event(void *data, uint64_t expirations) {
pw_stream_queue_buffer(cast->stream, pw_buf);
out:
xdpw_wlr_frame_free(cast);
}