Revert "feat(pulseaudio): mute microphone instead of sink"

This reverts commit e4bfce692fa8d325e9ee5c9e8b040cc01e319abe.
This commit is contained in:
D3SOX 2022-05-27 18:46:21 +02:00
parent 0e5e64376c
commit e78f17fa6e
No known key found for this signature in database
GPG Key ID: 39EC1673FC37B048
2 changed files with 2 additions and 16 deletions

View File

@ -144,8 +144,7 @@ namespace Soundux::Objects
fetchLoopBackSinkId(); fetchLoopBackSinkId();
if (!nullSink || !loopBack || !loopBackSink || !passthrough || !passthroughSink || !passthroughLoopBack || if (!nullSink || !loopBack || !loopBackSink || !passthrough || !passthroughSink || !passthroughLoopBack)
!defaultSourceId)
{ {
unloadLeftOvers(); unloadLeftOvers();
return false; return false;
@ -196,17 +195,6 @@ namespace Soundux::Objects
} }
}, },
this)); this));
await(PulseApi::context_get_sink_input_info_list(
context,
[]([[maybe_unused]] pa_context *ctx, const pa_sink_input_info *info, [[maybe_unused]] int eol,
void *userData) {
auto *thiz = reinterpret_cast<PulseAudio *>(userData);
if (info && info->name == thiz->defaultSource)
{
thiz->defaultSourceId = info->index;
}
},
this));
} }
void PulseAudio::fetchLoopBackSinkId() void PulseAudio::fetchLoopBackSinkId()
{ {
@ -642,7 +630,7 @@ namespace Soundux::Objects
bool success = false; bool success = false;
await(PulseApi::context_set_sink_input_mute( await(PulseApi::context_set_sink_input_mute(
context, *defaultSourceId, state, context, *loopBackSink, state,
+[]([[maybe_unused]] pa_context *ctx, int success, void *userData) { +[]([[maybe_unused]] pa_context *ctx, int success, void *userData) {
*reinterpret_cast<bool *>(userData) = success; *reinterpret_cast<bool *>(userData) = success;
}, },

View File

@ -47,9 +47,7 @@ namespace Soundux
//* ~= ~~~~~~~~~~~~~~~~~~~~~ =~ //* ~= ~~~~~~~~~~~~~~~~~~~~~ =~
std::string serverName; std::string serverName;
std::string defaultSource; std::string defaultSource;
std::optional<std::uint32_t> defaultSourceId;
std::map<std::string, std::uint32_t> movedApplications; std::map<std::string, std::uint32_t> movedApplications;
std::map<std::string, std::uint32_t> movedPassthroughApplications; std::map<std::string, std::uint32_t> movedPassthroughApplications;