Skip to content

Commit

Permalink
add runtime check for pipewire as discussed in #561
Browse files Browse the repository at this point in the history
check if loop was created by pw_main_loop_new
  • Loading branch information
karlstav committed May 7, 2024
1 parent b7e9a17 commit a7adab5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions input/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ void *input_pipewire(void *audiodata) {
pw_init(0, 0);

data.loop = pw_main_loop_new(NULL);
if (data.loop == NULL) {
data.cava_audio->terminate = 1;
sprintf(data.cava_audio->error_message, __FILE__ ": Could not create main loop");
return 0;
}

pw_loop_add_signal(pw_main_loop_get_loop(data.loop), SIGINT, do_quit, &data);
pw_loop_add_signal(pw_main_loop_get_loop(data.loop), SIGTERM, do_quit, &data);
Expand Down

0 comments on commit a7adab5

Please sign in to comment.