Remove unecessary checks in wlr_screencast.c

This commit is contained in:
columbarius 2020-08-10 23:07:32 +02:00 committed by Simon Ser
parent c6253415c0
commit 15e30ed35d

View file

@ -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); 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"); logprint(DEBUG, "wlroots: create shm buffer");
cast->simple_frame.buffer = create_shm_buffer(cast, format, width, height, cast->simple_frame.buffer = create_shm_buffer(cast, format, width, height,
stride, &cast->simple_frame.data); stride, &cast->simple_frame.data);
} else { } else {
logprint(DEBUG,"wlroots: shm buffer or data exists"); logprint(DEBUG,"wlroots: shm buffer exists");
} }
if (cast->simple_frame.buffer == NULL) { if (cast->simple_frame.buffer == NULL) {
@ -144,11 +144,6 @@ static void wlr_frame_buffer(void *data, struct zwlr_screencopy_frame_v1 *frame,
abort(); 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); zwlr_screencopy_frame_v1_copy_with_damage(frame, cast->simple_frame.buffer);
logprint(TRACE, "wlroots: frame copied"); logprint(TRACE, "wlroots: frame copied");
} }