From 724231700bc52645aa133916c7e8b34261d616eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Tue, 9 Apr 2024 14:11:36 -0400
Subject: [PATCH] conference: minor cleanup

Change-Id: I1efc8596305825154632fec92a66c7c08f003c70
---
 src/conference.cpp |  6 +++---
 src/conference.h   | 26 +++++++++++++-------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/conference.cpp b/src/conference.cpp
index ea86ef2906..f77996f9ca 100644
--- a/src/conference.cpp
+++ b/src/conference.cpp
@@ -309,7 +309,7 @@ Conference::setState(State state)
 }
 
 void
-Conference::setLocalHostDefaultMediaSource()
+Conference::initSourcesForHost()
 {
     hostSources_.clear();
     // Setup local audio source
@@ -907,7 +907,7 @@ Conference::attachHost()
 
     if (getState() == State::ACTIVE_DETACHED) {
         setState(State::ACTIVE_ATTACHED);
-        setLocalHostDefaultMediaSource();
+        initSourcesForHost();
         bindHostAudio();
 #ifdef ENABLE_VIDEO
         if (videoMixer_) {
@@ -946,7 +946,7 @@ Conference::detachHost()
         return;
     }
 
-    setLocalHostDefaultMediaSource();
+    initSourcesForHost();
     setState(State::ACTIVE_DETACHED);
 }
 
diff --git a/src/conference.h b/src/conference.h
index e5de287ac0..976375c3bf 100644
--- a/src/conference.h
+++ b/src/conference.h
@@ -248,11 +248,6 @@ public:
 
     const char* getStateStr() const { return getStateStr(confState_); }
 
-    /**
-     * Set default media source for the local host
-     */
-    void setLocalHostDefaultMediaSource();
-
     /**
      * Set the mute state of the local host
      */
@@ -263,14 +258,6 @@ public:
      */
     bool isMediaSourceMuted(MediaType type) const;
 
-    /**
-     * Take over media control from the call.
-     * When a call joins a conference, the media control (mainly mute/un-mute
-     * state of the local media source) will be handled by the conference and
-     * the mixer.
-     */
-    void takeOverMediaSourceControl(const std::string& callId);
-
     /**
      * Process a media change request.
      * Used to change the media attributes of the host.
@@ -516,6 +503,19 @@ private:
     std::function<void(int)> shutdownCb_;
     clock::time_point duration_start_;
 
+    /**
+     * Initialize sources for host (takes default camera/audio)
+     */
+    void initSourcesForHost();
+
+    /**
+     * Take over media control from the call.
+     * When a call joins a conference, the media control (mainly mute/un-mute
+     * state of the local media source) will be handled by the conference and
+     * the mixer.
+     */
+    void takeOverMediaSourceControl(const std::string& callId);
+
     /**
      * Bind host's audio
      */
-- 
GitLab