Skip to content
Snippets Groups Projects
Commit b71c65d4 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

conference: do not bind audio for muted participants

Change-Id: I9185ae55bd507b2b9869545928ad8792c81e4172
GitLab: #552
parent 0208aaa3
Branches
No related tags found
No related merge requests found
...@@ -443,7 +443,14 @@ Conference::attach() ...@@ -443,7 +443,14 @@ Conference::attach()
if (getState() == State::ACTIVE_DETACHED) { if (getState() == State::ACTIVE_DETACHED) {
auto& rbPool = Manager::instance().getRingBufferPool(); auto& rbPool = Manager::instance().getRingBufferPool();
for (const auto& participant : getParticipantList()) { for (const auto& participant : getParticipantList()) {
if (auto call = Manager::instance().getCallFromCallID(participant)) {
if (isMuted(string_remove_suffix(call->getPeerNumber(), '@')))
rbPool.bindHalfDuplexOut(participant, RingBufferPool::DEFAULT_ID);
else
rbPool.bindCallID(participant, RingBufferPool::DEFAULT_ID); rbPool.bindCallID(participant, RingBufferPool::DEFAULT_ID);
rbPool.flush(participant);
}
// Reset ringbuffer's readpointers // Reset ringbuffer's readpointers
rbPool.flush(participant); rbPool.flush(participant);
} }
...@@ -497,14 +504,24 @@ Conference::bindParticipant(const std::string& participant_id) ...@@ -497,14 +504,24 @@ Conference::bindParticipant(const std::string& participant_id)
auto& rbPool = Manager::instance().getRingBufferPool(); auto& rbPool = Manager::instance().getRingBufferPool();
for (const auto& item : participants_) { for (const auto& item : participants_) {
if (participant_id != item) if (participant_id != item) {
// Do not attach muted participants
if (auto call = Manager::instance().getCallFromCallID(item)) {
if (isMuted(string_remove_suffix(call->getPeerNumber(), '@')))
rbPool.bindHalfDuplexOut(item, participant_id);
else
rbPool.bindCallID(participant_id, item); rbPool.bindCallID(participant_id, item);
}
}
rbPool.flush(item); rbPool.flush(item);
} }
// Bind local participant to other participants only if the // Bind local participant to other participants only if the
// local is attached to the conference. // local is attached to the conference.
if (getState() == State::ACTIVE_ATTACHED) { if (getState() == State::ACTIVE_ATTACHED) {
if (isMuted("host"sv))
rbPool.bindHalfDuplexOut(RingBufferPool::DEFAULT_ID, participant_id);
else
rbPool.bindCallID(participant_id, RingBufferPool::DEFAULT_ID); rbPool.bindCallID(participant_id, RingBufferPool::DEFAULT_ID);
rbPool.flush(RingBufferPool::DEFAULT_ID); rbPool.flush(RingBufferPool::DEFAULT_ID);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment