Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fepitre committed Jul 17, 2024
1 parent 353cc16 commit b64f11f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pulse/pacat-simple-vchan.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,11 +848,9 @@ static void control_socket_callback(pa_mainloop_api *UNUSED(a),
return;

new_rec_allowed = is_rec_allowed_from_qdb(u);
if (new_rec_allowed != -1) {
if (new_rec_allowed >= 0) {
g_mutex_lock(&u->prop_mutex);
pacat_log("something %d", new_rec_allowed);
if (new_rec_allowed != u->rec_allowed) {
pacat_log("something else %d", new_rec_allowed);
u->rec_allowed = new_rec_allowed;
pacat_log("Setting audio-input to %s", u->rec_allowed ? "enabled" : "disabled");
if (u->rec_allowed && u->rec_requested) {
Expand All @@ -873,6 +871,7 @@ static void control_socket_callback(pa_mainloop_api *UNUSED(a),

static int setup_control(struct userdata *u) {
int socket_fd = -1;
int rec_allowed;

u->qdb = qdb_open(NULL);
if (!u->qdb) {
Expand All @@ -895,6 +894,12 @@ static int setup_control(struct userdata *u) {
if (socket_fd < 0)
goto fail;

rec_allowed = is_rec_allowed_from_qdb(u);
if (rec_allowed >= 0) {
pacat_log("initial value read from Qubes DB for rec_allowed: %d", rec_allowed);
u->rec_allowed = rec_allowed;
}

u->control_socket_event = u->mainloop_api->io_new(u->mainloop_api,
socket_fd, PA_IO_EVENT_INPUT, control_socket_callback, u);
if (!u->control_socket_event) {
Expand Down

0 comments on commit b64f11f

Please sign in to comment.