From 15e30ed35ddbea5abbcd14b5811d3561eaad123a Mon Sep 17 00:00:00 2001 From: columbarius Date: Mon, 10 Aug 2020 23:07:32 +0200 Subject: [PATCH] Remove unecessary checks in wlr_screencast.c --- src/screencast/wlr_screencast.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/screencast/wlr_screencast.c b/src/screencast/wlr_screencast.c index 9003397..7299e5a 100644 --- a/src/screencast/wlr_screencast.c +++ b/src/screencast/wlr_screencast.c @@ -131,12 +131,12 @@ static void wlr_frame_buffer(void *data, struct zwlr_screencopy_frame_v1 *frame, wlr_frame_buffer_chparam(cast, format, width, height, stride); } - if (cast->simple_frame.buffer == NULL && cast->simple_frame.data == NULL) { + if (cast->simple_frame.buffer == NULL) { logprint(DEBUG, "wlroots: create shm buffer"); cast->simple_frame.buffer = create_shm_buffer(cast, format, width, height, stride, &cast->simple_frame.data); } else { - logprint(DEBUG,"wlroots: shm buffer or data exists"); + logprint(DEBUG,"wlroots: shm buffer exists"); } if (cast->simple_frame.buffer == NULL) { @@ -144,11 +144,6 @@ static void wlr_frame_buffer(void *data, struct zwlr_screencopy_frame_v1 *frame, abort(); } - if (cast->simple_frame.data == NULL) { - logprint(ERROR, "wlroots: failed to map data"); - abort(); - } - zwlr_screencopy_frame_v1_copy_with_damage(frame, cast->simple_frame.buffer); logprint(TRACE, "wlroots: frame copied"); }