mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-27 20:36:50 -08:00
Catch exceptions when updating mic state
This commit is contained in:
1 parent
fc01002317
commit
3f58345cf0
1 file changed
+16
-2
@@ -354,10 +354,24 @@ void pipewire_device::mic_state_changed(void * self_v, pw_stream_state old, pw_s
|
||||
case PW_STREAM_STATE_UNCONNECTED:
|
||||
case PW_STREAM_STATE_CONNECTING:
|
||||
case PW_STREAM_STATE_PAUSED:
|
||||
self->session.send_control(to_headset::feature_control{to_headset::feature_control::microphone, false});
|
||||
try
|
||||
{
|
||||
self->session.send_control(to_headset::feature_control{to_headset::feature_control::microphone, false});
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
U_LOG_W("failed to update microphone state: %s", e.what());
|
||||
}
|
||||
return;
|
||||
case PW_STREAM_STATE_STREAMING:
|
||||
self->session.send_control(to_headset::feature_control{to_headset::feature_control::microphone, true});
|
||||
try
|
||||
{
|
||||
self->session.send_control(to_headset::feature_control{to_headset::feature_control::microphone, true});
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
U_LOG_W("failed to update microphone state: %s", e.what());
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user