Skip to content

Commit

Permalink
screencast: use asserts for fatal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
columbarius committed Nov 6, 2021
1 parent 91c53a9 commit ca00e96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/screencast/pipewire_screencast.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,7 @@ void xdpw_pwr_enqueue_buffer(struct xdpw_screencast_instance *cast) {
struct pw_buffer *pw_buf = cast->current_frame.current_pw_buffer;
bool buffer_corrupt = cast->frame_state != XDPW_FRAME_STATE_SUCCESS;

if (!pw_buf) {
logprint(TRACE, "pipewire: no pipewire buffer to queue");
return;
}
assert(pw_buf);

struct spa_buffer *spa_buf = pw_buf->buffer;
struct spa_data *d = spa_buf->datas;
Expand Down
6 changes: 2 additions & 4 deletions src/screencast/wlr_screencast.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <assert.h>
#include <wayland-client-protocol.h>

#include "screencast.h"
Expand Down Expand Up @@ -151,10 +152,7 @@ static void wlr_frame_buffer_done(void *data,
return;
}

if (cast->current_frame.buffer == NULL) {
logprint(ERROR, "wlroots: imported buffer doesn't contain a wlr_buffer");
abort();
}
assert(cast->current_frame.buffer);

zwlr_screencopy_frame_v1_copy_with_damage(frame, cast->current_frame.buffer);
logprint(TRACE, "wlroots: frame copied");
Expand Down

0 comments on commit ca00e96

Please sign in to comment.