Skip to content
Snippets Groups Projects
Unverified Commit 4337438d authored by Sébastien Blin's avatar Sébastien Blin
Browse files

video_mixer: fix setActiveParticipant(nullptr)

setActiveParticipant(nullptr) is the only way for now to set the active
participant to the local video. But the local video is not necessarely
the first one. So, sometimes, setActiveParticipant(nullptr) was choosing
another active participant instead the local one.

Change-Id: I868770beb042977ce5ddd0f2dce00451cac04323
parent e6472cc5
No related branches found
No related tags found
No related merge requests found
...@@ -132,7 +132,7 @@ VideoMixer::stopInput() ...@@ -132,7 +132,7 @@ VideoMixer::stopInput()
void void
VideoMixer::setActiveParticipant(Observable<std::shared_ptr<MediaFrame>>* ob) VideoMixer::setActiveParticipant(Observable<std::shared_ptr<MediaFrame>>* ob)
{ {
activeSource_ = ob; activeSource_ = ob ? ob : videoLocal_.get();
layoutUpdated_ += 1; layoutUpdated_ += 1;
} }
...@@ -157,7 +157,7 @@ VideoMixer::detached(Observable<std::shared_ptr<MediaFrame>>* ob) ...@@ -157,7 +157,7 @@ VideoMixer::detached(Observable<std::shared_ptr<MediaFrame>>* ob)
// Handle the case where the current shown source leave the conference // Handle the case where the current shown source leave the conference
if (activeSource_ == ob) { if (activeSource_ == ob) {
currentLayout_ = Layout::GRID; currentLayout_ = Layout::GRID;
activeSource_ = nullptr; activeSource_ = videoLocal_.get();
} }
sources_.remove(x); sources_.remove(x);
layoutUpdated_ += 1; layoutUpdated_ += 1;
...@@ -219,8 +219,7 @@ VideoMixer::process() ...@@ -219,8 +219,7 @@ VideoMixer::process()
return; return;
if (currentLayout_ != Layout::ONE_BIG or activeSource_ == x->source if (currentLayout_ != Layout::ONE_BIG or activeSource_ == x->source
or (not activeSource_ or not activeFound /* By default ONE_BIG will show the first source */) {
and not activeFound) /* By default ONE_BIG will show the first source */) {
// make rendered frame temporarily unavailable for update() // make rendered frame temporarily unavailable for update()
// to avoid concurrent access. // to avoid concurrent access.
std::unique_ptr<VideoFrame> input; std::unique_ptr<VideoFrame> input;
...@@ -231,9 +230,6 @@ VideoMixer::process() ...@@ -231,9 +230,6 @@ VideoMixer::process()
wantedIndex = 0; wantedIndex = 0;
activeFound = true; activeFound = true;
} else if (currentLayout_ == Layout::ONE_BIG_WITH_SMALL) { } else if (currentLayout_ == Layout::ONE_BIG_WITH_SMALL) {
if (!activeSource_ && i == 0) {
activeFound = true;
}
if (activeSource_ == x->source) { if (activeSource_ == x->source) {
wantedIndex = 0; wantedIndex = 0;
activeFound = true; activeFound = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment