Skip to content

Commit

Permalink
Fix segfault on new playback sink creation on PipeWire
Browse files Browse the repository at this point in the history
Before this commit, ncpamixer segfaults when running under
pipewire-pulse when a new playback sink is created while ncpamixer is
running.
  • Loading branch information
durcor committed Feb 16, 2021
1 parent 2bf5ce6 commit 30aa766
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/pa.cpp
Expand Up @@ -582,19 +582,8 @@ void Pa::create_monitor_stream_for_paobject(PaObject *po)
po->monitor_stream = nullptr;
}

if (po->type == pa_object_t::INPUT) {
PaInput *input = reinterpret_cast<PaInput *>(po);
input->monitor_stream = create_monitor_stream_for_source(
PA_SINKS[input->sink]->monitor_index,
input->index
);
} else {
po->monitor_stream = create_monitor_stream_for_source(
po->monitor_index,
-1
);

}
po->monitor_stream = create_monitor_stream_for_source
(po->monitor_index, po->type == pa_object_t::INPUT ? po->index : -1);
}

void Pa::set_notify_update_cb(const notify_update_callback &cb)
Expand Down

0 comments on commit 30aa766

Please sign in to comment.