Added some sanity checks for no sink being detected.
This commit is contained in:
parent
6000b85b1a
commit
d4a4096bba
2 changed files with 23 additions and 12 deletions
|
|
@ -162,8 +162,14 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
|||
if(!ref->sink_flag->exchange(true, std::memory_order_acquire)) {
|
||||
ref->restore_sink = !config.flags[config_t::HOST_AUDIO];
|
||||
|
||||
// If the sink is empty (Host has no sink!), definately switch to the virtual.
|
||||
if (ref->sink.host.empty()) {
|
||||
if (control->set_sink(*sink)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// If the client requests audio on the host, don't change the default sink
|
||||
if(!config.flags[config_t::HOST_AUDIO] && control->set_sink(*sink)) {
|
||||
else if(!config.flags[config_t::HOST_AUDIO] && control->set_sink(*sink)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue