aboutsummaryrefslogtreecommitdiff
path: root/src/capture/xcomposite.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-21 16:38:15 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-21 16:38:15 +0200
commit95e1971f8fc2b9f1814a80ffa19d17fc4eda9e47 (patch)
treeb2a288c1aa46be23aa91f304cc55f8fc5c5909f7 /src/capture/xcomposite.c
parentfb707aee6f61cef84cc15a3a00f46e7bf52f3ceb (diff)
Fix first frame is black
Diffstat (limited to 'src/capture/xcomposite.c')
-rw-r--r--src/capture/xcomposite.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c
index 31d0b7e..9d053bb 100644
--- a/src/capture/xcomposite.c
+++ b/src/capture/xcomposite.c
@@ -258,6 +258,9 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_
const vec2i target_pos = { max_int(0, frame->width / 2 - self->texture_size.x / 2), max_int(0, frame->height / 2 - self->texture_size.y / 2) };
+ self->params.egl->glFlush();
+ self->params.egl->glFinish();
+
/* Fast opengl free path */
if(video_codec_context_is_vaapi(self->video_codec_context) && self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD) {
vaapi_copy_egl_image_to_video_surface(self->params.egl, self->window_texture.image, (vec2i){0, 0}, self->texture_size, target_pos, self->texture_size, self->video_codec_context, frame);