Exit with exit code 10 if pkexec fails
This commit is contained in:
@@ -139,9 +139,10 @@ static int gsr_capture_kms_cuda_start(gsr_capture *cap, AVCodecContext *video_co
|
||||
}
|
||||
cap_kms->using_wayland_capture = true;
|
||||
} else {
|
||||
if(gsr_kms_client_init(&cap_kms->kms_client, cap_kms->params.card_path) != 0) {
|
||||
int kms_init_res = gsr_kms_client_init(&cap_kms->kms_client, cap_kms->params.card_path);
|
||||
if(kms_init_res != 0) {
|
||||
gsr_capture_kms_cuda_stop(cap, video_codec_context);
|
||||
return -1;
|
||||
return kms_init_res;
|
||||
}
|
||||
|
||||
MonitorCallbackUserdata monitor_callback_userdata = {
|
||||
|
||||
@@ -142,9 +142,10 @@ static int gsr_capture_kms_vaapi_start(gsr_capture *cap, AVCodecContext *video_c
|
||||
}
|
||||
cap_kms->using_wayland_capture = true;
|
||||
} else {
|
||||
if(gsr_kms_client_init(&cap_kms->kms_client, cap_kms->params.card_path) != 0) {
|
||||
int kms_init_res = gsr_kms_client_init(&cap_kms->kms_client, cap_kms->params.card_path);
|
||||
if(kms_init_res != 0) {
|
||||
gsr_capture_kms_vaapi_stop(cap, video_codec_context);
|
||||
return -1;
|
||||
return kms_init_res;
|
||||
}
|
||||
|
||||
MonitorCallbackUserdata monitor_callback_userdata = {
|
||||
|
||||
@@ -536,6 +536,8 @@ void gsr_egl_unload(gsr_egl *self) {
|
||||
}
|
||||
|
||||
bool gsr_egl_supports_wayland_capture(gsr_egl *self) {
|
||||
// TODO: wlroots capture is broken right now (black screen) on amd and multiple monitors
|
||||
// so it has to be disabled right now. Find out why it happens and fix it.
|
||||
(void)self;
|
||||
return false;
|
||||
//return !!self->wayland.export_manager && self->wayland.num_outputs > 0;
|
||||
|
||||
@@ -1687,9 +1687,10 @@ int main(int argc, char **argv) {
|
||||
if(replay_buffer_size_secs == -1)
|
||||
video_stream = create_stream(av_format_context, video_codec_context);
|
||||
|
||||
if(gsr_capture_start(capture, video_codec_context) != 0) {
|
||||
int capture_result = gsr_capture_start(capture, video_codec_context);
|
||||
if(capture_result != 0) {
|
||||
fprintf(stderr, "gsr error: gsr_capture_start failed\n");
|
||||
_exit(1);
|
||||
_exit(capture_result);
|
||||
}
|
||||
|
||||
open_video(video_codec_context, quality, very_old_gpu, gpu_inf.vendor, pixel_format);
|
||||
|
||||
Reference in New Issue
Block a user