diff --git a/daemon/session_manager.cpp b/daemon/session_manager.cpp index 6ead695..c65d26c 100644 --- a/daemon/session_manager.cpp +++ b/daemon/session_manager.cpp @@ -1054,9 +1054,10 @@ std::list SessionManager::get_updated_sinks( return sinks_list; } -void SessionManager::update_sinks(const std::list& sources_list) { +void SessionManager::update_sinks() { if (config_->get_auto_sinks_update()) { - auto sinks_list = get_updated_sinks(sources_list); + std::list remote_sources = browser_->get_remote_sources(); + auto sinks_list = get_updated_sinks(remote_sources); for (auto& sink : sinks_list) { // Re-add sink with new SDP, since the sink.id is the same there will be // an update @@ -1214,10 +1215,7 @@ bool SessionManager::worker() { << sap_interval << " secs"; } - /* Use a newer version of source if the current version isn't available - * anymore. This typically happens when equipment is restarted. */ - std::list remote_sources = browser_->get_remote_sources(); - update_sinks(remote_sources); + update_sinks(); std::this_thread::sleep_for(std::chrono::seconds(1)); } diff --git a/daemon/session_manager.hpp b/daemon/session_manager.hpp index 5b9dda0..5de2495 100644 --- a/daemon/session_manager.hpp +++ b/daemon/session_manager.hpp @@ -170,7 +170,7 @@ class SessionManager { std::list get_updated_sinks( const std::list& sources_list); - void update_sinks(const std::list& sources_list); + void update_sinks(); void on_add_source(const StreamSource& source, const StreamInfo& info); void on_remove_source(const StreamInfo& info);