Try to make the audio sink mess clear
This commit is contained in:
@@ -192,6 +192,8 @@ namespace audio {
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_LOG(info) << "Selected audio sink: "sv << *sink;
|
||||
|
||||
// Only the first to start a session may change the default sink
|
||||
if (!ref->sink_flag->exchange(true, std::memory_order_acquire)) {
|
||||
// If the selected sink is different than the current one, change sinks.
|
||||
@@ -238,14 +240,17 @@ namespace audio {
|
||||
case platf::capture_e::timeout:
|
||||
continue;
|
||||
case platf::capture_e::reinit:
|
||||
BOOST_LOG(info) << "Reinitializing audio capture"sv;
|
||||
mic.reset();
|
||||
do {
|
||||
mic = control->microphone(stream.mapping, stream.channelCount, stream.sampleRate, frame_size);
|
||||
if (!mic) {
|
||||
BOOST_LOG(warning) << "Couldn't re-initialize audio input"sv;
|
||||
}
|
||||
} while (!mic && !shutdown_event->view(5s));
|
||||
if (config::audio.auto_capture) {
|
||||
BOOST_LOG(info) << "Reinitializing audio capture"sv;
|
||||
mic.reset();
|
||||
do {
|
||||
mic = control->microphone(stream.mapping, stream.channelCount, stream.sampleRate, frame_size);
|
||||
if (!mic) {
|
||||
BOOST_LOG(warning) << "Couldn't re-initialize audio input"sv;
|
||||
}
|
||||
} while (!mic && !shutdown_event->view(5s));
|
||||
}
|
||||
|
||||
continue;
|
||||
default:
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user